#include <stdlib.h> int bar(baz) struct { int foo; } baz; { return baz.foo; }
int main (void) { struct { int foo; } baz; baz.foo = 0xdeadbeef; if (bar(baz) != 0xdeadbeef) abort(); } Compiling at O2 results in no error. compiling at O3 results in the following error : fail.c:35: error: incompatible type for argument 1 of 'bar' This is a regression from 3.4.x .Have not checked this for mainline yet. -- Summary: Rejects valid code at different optimization levels. Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ramana dot radhakrishnan at codito dot com GCC host triplet: i686-linux-gnu GCC target triplet: arm-none-eabi http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26732