The following invalid testcase crashes the C++ frontend since GCC 3.4.0: ===================== void foo() { asm("" ::: X); } ===================== bug.cc: In function 'void foo()': bug.cc:3: error: expected string-literal before 'X' bug.cc:3: error: expected `)' before 'X' bug.cc:3: internal compiler error: tree check: expected string_cst, have error_mark in expand_asm_operands, at stmt.c:696 Please submit a full bug report, [etc.] The C frontend is not affected.
Confirmed, the C front-end does not even include the asm in the IR while the C++ Front-end does.
Subject: Bug number PR c++/27451 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-05/msg01090.html
Posted a patch.
Subject: Bug 27451 Author: reichelt Date: Mon May 22 16:49:33 2006 New Revision: 113985 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113985 Log: PR c++/27451 * stmt.c (expand_asm_operands): Skip asm statement with erroneous clobbers. * g++.dg/ext/asm9.C: New test. Added: trunk/gcc/testsuite/g++.dg/ext/asm9.C Modified: trunk/gcc/ChangeLog trunk/gcc/stmt.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 27451 Author: reichelt Date: Mon May 22 16:53:38 2006 New Revision: 113986 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113986 Log: PR c++/27451 * stmt.c (expand_asm_operands): Skip asm statement with erroneous clobbers. * g++.dg/ext/asm9.C: New test. Added: branches/gcc-4_0-branch/gcc/testsuite/g++.dg/ext/asm9.C Modified: branches/gcc-4_0-branch/gcc/ChangeLog branches/gcc-4_0-branch/gcc/stmt.c branches/gcc-4_0-branch/gcc/testsuite/ChangeLog
Fixed on mainline and 4.0 branch. Waiting for the 4.1 branch to thaw.
Subject: Bug 27451 Author: reichelt Date: Mon May 29 06:50:07 2006 New Revision: 114189 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114189 Log: PR c++/27451 * stmt.c (expand_asm_operands): Skip asm statement with erroneous clobbers. * g++.dg/ext/asm9.C: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/ext/asm9.C Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/stmt.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Now also fixed on the 4.1 branch.