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++/27115] [4.0/4.1/4.2 Regression] ICE in cp_expr_size or miscompilation



------- Comment #3 from reichelt at gcc dot gnu dot org  2006-04-12 12:11 -------
Here's a shorter testcase for the wrong-code problem (using "-O"):
It should return 0, but returns something else since GCC 4.0.2.
The compiler crashes on this testcase with GCC 3.3 - 4.0.1.

=========================================================
struct A
{
  int i;
  A (int j) : i(j) {}
  A (const A &j) : i(j.i) {}
  A& operator= (const A &j) { i = j.i; return *this; }
};

A foo(int j)
{
  return ({ j ? A(1) : A(0); });
}

int main()
{
  return foo(1).i-1;
}
=========================================================


-- 


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


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