A funny use of __attribute__ ((packed)) caused a seg fault. 
Code: 
====== (see attachment for full preprocessed file)
struct wrap_a {int a;};
struct wrap_b {long b;}; // note: 64bit machine
typedef std::pair<wrap_a __attribute__ ((packed)), wrap_b> my_pair; // crash!
======
Command line: 
g++ /tmp/g++bug.cc
======
Output: 
/tmp/g++bug.cc: In function ‘int main()’:
/tmp/g++bug.cc:11: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccklpUdO.out file, please attach this to
your bugreport.


-- 
           Summary: Internal compiler error: Segmentation fault, when
                    incorrectly using __attribute__ ((packed))
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vanco dot gccbugzilla at vancomaja dot com
 GCC build triplet: Configured with: ../configure --prefix=/usr --
                    mandir=/usr/share/
  GCC host triplet: Using built-in specs
GCC target triplet: x86_64-redhat-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36794

Reply via email to