This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/49651] [C++0x] nested lambdas and -O3 produced incorrect integer variable increments
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 14 Jul 2011 12:37:30 +0000
- Subject: [Bug tree-optimization/49651] [C++0x] nested lambdas and -O3 produced incorrect integer variable increments
- Auto-submitted: auto-generated
- References: <bug-49651-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49651
--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-14 12:36:23 UTC ---
C testcase that fails at -O2:
extern void abort (void);
struct X {
int *p;
int *q;
};
void __attribute__((noinline, noclone))
foo (struct X x) { *x.q = 0; }
volatile int what;
struct X y;
int main()
{
int i, j;
struct X x, *p;
x.p = &i;
x.q = &j;
if (what)
p = &y;
else
p = &x;
j = 1;
foo (*p);
if (j != 0)
abort ();
return 0;
}
workaround: --param max-fields-for-field-sensitive=1