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++/11547] New: [3.4 regression] ICE with const temporaries


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [3.4 regression] ICE with const temporaries
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: critical
          Priority: P1
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu

The following valid code snippet crashes mainline since 3.4-20030709
(just compile with "g++ -c"):

---------------------------------------------
struct A
{
    int foo () const { return 0; }
};

template <typename> void bar (int x[], const A &a)
{
    const int i=a.foo();
    x[i]=0;
}
---------------------------------------------

The error message is:
bug.ii: In function `void bar(int*, const A&)':
bug.ii:9: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]

If I remove the const qualifier on i, the code compiles fine.


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