public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/38427]  New: crash for reference init code
@ 2008-12-06 11:45 dcb314 at hotmail dot com
  2008-12-06 12:05 ` [Bug c++/38427] [4.4 Regression] " rguenth at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dcb314 at hotmail dot com @ 2008-12-06 11:45 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-12-18 20:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-06 11:45 [Bug c++/38427] New: crash for reference init code dcb314 at hotmail dot com
2008-12-06 12:05 ` [Bug c++/38427] [4.4 Regression] " rguenth at gcc dot gnu dot org
2008-12-09 19:38 ` mmitchel at gcc dot gnu dot org
2008-12-18 20:53 ` jakub at gcc dot gnu dot org
2008-12-18 20:59 ` jakub at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).