This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/38427] New: crash for reference init code


I just tried to compile the following C++ source code
with the GNU C compiler version 4.4 snapshot 20081205.

struct S
{
        int & ref;
        S() : ref() {
        };
};

The compiler said

$ ~/gcc/20081205/results/bin/g++ jun17.cc
jun17.cc: In constructor 'S::S()':
jun17.cc:5: warning: default-initialization of 'int& S::ref', which has
reference type
jun17.cc:5: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Here is valgrind helping out with a stack backtrace

==32646== Invalid read of size 2
==32646==    at 0x54A935: cp_gimplify_expr (cp-gimplify.c:435)
==32646==    by 0x6FB6F4: gimplify_expr (gimplify.c:6255)
==32646==    by 0x704DD6: gimplify_stmt (gimplify.c:5006)
==32646==    by 0x705E4B: gimplify_cleanup_point_expr (gimplify.c:4808)
==32646==    by 0x6FC164: gimplify_expr (gimplify.c:6576)
==32646==    by 0x704DD6: gimplify_stmt (gimplify.c:5006)
==32646==    by 0x7058B5: gimplify_bind_expr (gimplify.c:1264)
==32646==    by 0x6FBF36: gimplify_expr (gimplify.c:6430)
==32646==    by 0x704DD6: gimplify_stmt (gimplify.c:5006)
==32646==    by 0x704EBD: gimplify_body (gimplify.c:7226)
==32646==    by 0x7051B4: gimplify_function_tree (gimplify.c:7304)
==32646==    by 0x58B259: c_genericize (c-gimplify.c:107)
==32646==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

This code used to compile ok on snapshot 20081128


-- 
           Summary: crash for reference init code
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dcb314 at hotmail dot com
  GCC host triplet: suse-linux-x86_64


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]