Re: Missed optimizations at -Os

2017-01-17 Thread Richard Biener
On Tue, 17 Jan 2017, Senthil Kumar Selvaraj wrote: > Hi, > > For this (reduced) test case > > > extern int x, y, z; > void foo(void); > void bar(void); > void blah(void); > > void test (void) > { > int flag = 0; > flag = ((x && y) || z); > > if (flag && x && y) { > bar(); > }

Missed optimizations at -Os

2017-01-17 Thread Senthil Kumar Selvaraj
Hi, For this (reduced) test case extern int x, y, z; void foo(void); void bar(void); void blah(void); void test (void) { int flag = 0; flag = ((x && y) || z); if (flag && x && y) { bar(); } } I expected gcc -Os (x86_64, if it matters) to generate code equivalent to if (x &