The following code snippet triggers an ICE since GCC 4.1.0: ========================================================== void foo(int i __attribute__((__weakref__ ("xyz")))); ========================================================== bug.c:1: internal compiler error: tree check: expected tree that contains 'decl with visibility' structure, have 'parm_decl' in handle_weakref_attribute, at c-common.c:6162 Please submit a full bug report, [etc.] Before GCC 4.1.0 the code was accepted with the following warning: bug.c:1: warning: '__weakref__' attribute directive ignored
Subject: Bug 37645 Author: jakub Date: Fri Sep 26 05:09:29 2008 New Revision: 140680 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140680 Log: PR c/37645 * c-common.c (handle_weakref_attribute): Ignore the attribute unless the decl is a VAR_DECL or FUNCTION_DECL. * gcc.dg/pr37645.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr37645.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-common.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 37645 Author: jakub Date: Fri Sep 26 05:23:48 2008 New Revision: 140681 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140681 Log: PR c/37645 * c-common.c (handle_weakref_attribute): Ignore the attribute unless the decl is a VAR_DECL or FUNCTION_DECL. * gcc.dg/pr37645.c: New test. Added: branches/gcc-4_3-branch/gcc/testsuite/gcc.dg/pr37645.c Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/c-common.c branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
Fixed.