$ cat foobar.c union u { struct { int i; }; }; extern int somefunc(union u *); $ gcc --combine -c foobar.c foobar.c foobar.c:8: error: conflicting types for 'somefunc' foobar.c:8: error: previous declaration of 'somefunc' was here gcc version 4.1.0 20060304 (Red Hat 4.1.0-3) Happens on both PowerPC and i386. If the internal structure is made non-anonymous, it compiles.
Created attachment 11822 [details] Patch that fixes the bug This patch fixes the problem for me.
Subject: Bug number PR27898 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00187.html
That simple test case seems to have been fixed with your patch -- thanks. Next failure reported as PR28706. Full test cases in Red Hat bug #194327 at https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=194327
Subject: Bug 27898 Author: aoliva Date: Mon Nov 26 06:26:18 2007 New Revision: 130425 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130425 Log: PR c/27898 * c-typeck.c (tagged_types_tu_compatible_p): Enable exact matches between anonymous union fields. Modified: trunk/gcc/ChangeLog trunk/gcc/c-typeck.c
Fixed.
Subject: Bug 27898 Author: uros Date: Wed Mar 25 07:58:55 2009 New Revision: 145052 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145052 Log: PR c/27898 * gcc.dg/pr27898.c: New test. PR tree-optimization/32139 * gcc.c-torture/compile/pr32139.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr32139.c trunk/gcc/testsuite/gcc.dg/pr27898.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog