In a function attribute I had comma more than needed and I got an ICE. Below is a small program to demonstrate this: Michael Cieslinski void Dummy() __attribute__(( , )); void Dummy() {} int main (int argc, char **argv) { Dummy(); return 0; } when compiled it results in an ICE: g++ -c -o bug.o bug.cpp ../../../Portabel/MetisIP/link/bug.cpp:2: error: expected `)' before ',' token ../../../Portabel/MetisIP/link/bug.cpp:2: error: expected `)' before ',' token ../../../Portabel/MetisIP/link/bug.cpp:2: internal compiler error: tree check: expected tree_list, have error_mark in lookup_attribute, at tree.c:3080 Please submit a full bug report, with preprocessed source if appropriate. g++ -v Using built-in specs. Configured with: ../gcc40/configure --prefix=/usr/local/gcc40c --program- suffix=40c --with-arch=opteron --enable-languages=c,c++ --enable-checking Thread model: posix gcc version 4.0.0 20050130 (experimental)
Hmm, we used to accept this before 3.4.0 and we still do in the C front-end.
This a regression no matter if this is valid or invalid code, an ICE from compiling/not compiling is a regression.
Subject: Re: ICE with additional comma in attribute On Tue, 1 Feb 2005, pinskia at gcc dot gnu dot org wrote: > Hmm, we used to accept this before 3.4.0 and we still do in the C front-end. This is valid code (according to the documentation I wrote, "Attribute Syntax" in the manual): attributes may be empty.
: Search converges between 2002-12-14-trunk (#159) and 2002-12-29-trunk (#160). This is caused by the new parser as JSM said this is valid.
Created attachment 8151 [details] obvious fix Sorry Mark, I didn't notice this was assigned to you already. Maybe this takes some work out of your hands ;-)
Comment on attachment 8151 [details] obvious fix Except that it is an ICE on _valid_, not invalid. Bogus patch.
Subject: Bug 19739 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2005-02-10 00:34:47 Modified files: gcc/cp : ChangeLog call.c decl.c parser.c gcc/testsuite : ChangeLog gcc/testsuite/g++.dg/template: crash2.C Added files: gcc/testsuite/g++.dg/conversion: ambig1.C gcc/testsuite/g++.dg/ext: attrib19.C gcc/testsuite/g++.dg/parse: dtor5.C gcc/testsuite/g++.dg/template: dtor3.C static11.C Log message: PR c++/19787 * call.c (initialize_reference): Robustify. PR ++/19732 * decl.c (grokdeclarator): Check for invalid use of destructor names. PR c++/19762 * parser.c (cp_parser_unqualified_id): Avoid creating destructor names with invalid types. PR c++/19826 * parser.c (cp_parser_direct_declarator): Allow type-dependent expressions as array bounds. PR c++/19739 * parser.c (cp_parser_attributes_list): Allow empty lists. PR c++/19787 * g++.dg/conversion/ambig1.C: New test. PR c++/19739 * g++.dg/ext/attrib19.C: New test. PR c++/19732 * g++.dg/parse/dtor5.C: New test. PR c++/19762 * g++.dg/template/dtor3.C: New test. PR c++/19826 * g++.dg/template/static11.C: New test. * g++.dg/template/crash2.C: Remove dg-error marker. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4618&r2=1.4619 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.528&r2=1.529 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1360&r2=1.1361 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.313&r2=1.314 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5011&r2=1.5012 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/conversion/ambig1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/attrib19.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/dtor5.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/dtor3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/static11.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash2.C.diff?cvsroot=gcc&r1=1.3&r2=1.4
Fixed in 4.0.
Subject: Bug 19739 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: mmitchel@gcc.gnu.org 2005-02-10 01:10:16 Modified files: gcc/testsuite : ChangeLog gcc/cp : ChangeLog call.c parser.c Added files: gcc/testsuite/g++.dg/conversion: ambig1.C gcc/testsuite/g++.dg/ext: attrib19.C gcc/testsuite/g++.dg/template: dtor3.C Log message: PR c++/19787 * call.c (initialize_reference): Robustify. PR c++/19762 * parser.c (cp_parser_unqualified_id): Avoid creating destructor names with invalid types. PR c++/19739 * parser.c (cp_parser_attributes_list): Allow empty lists. PR c++/19787 * g++.dg/conversion/ambig1.C: New test. PR c++/19739 * g++.dg/ext/attrib19.C: New test. PR c++/19762 * g++.dg/template/dtor3.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.357&r2=1.3389.2.358 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/conversion/ambig1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/attrib19.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/dtor3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.195&r2=1.3892.2.196 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.452.2.22&r2=1.452.2.23 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.51&r2=1.157.2.52
Fixed in GCC 3.4.4.