re PR c++/27451 (ICE with invalid asm statement)

PR c++/27451
	* stmt.c (expand_asm_operands): Skip asm statement with erroneous
	clobbers.

	* g++.dg/ext/asm9.C: New test.

From-SVN: r113985
This commit is contained in:
Volker Reichelt 2006-05-22 16:49:33 +00:00 committed by Volker Reichelt
parent ba5719d9cd
commit 123b24e73b
4 changed files with 23 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2006-05-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27451
* stmt.c (expand_asm_operands): Skip asm statement with erroneous
clobbers.
2006-05-22 Richard Sandiford <richard@codesourcery.com>
PR rtl-optimization/25514

View File

@ -693,7 +693,11 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
CLEAR_HARD_REG_SET (clobbered_regs);
for (tail = clobbers; tail; tail = TREE_CHAIN (tail))
{
const char *regname = TREE_STRING_POINTER (TREE_VALUE (tail));
const char *regname;
if (TREE_VALUE (tail) == error_mark_node)
return;
regname = TREE_STRING_POINTER (TREE_VALUE (tail));
i = decode_reg_name (regname);
if (i >= 0 || i == -4)

View File

@ -1,3 +1,8 @@
2006-05-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27451
* g++.dg/ext/asm9.C: New test.
2006-05-22 Richard Sandiford <richard@codesourcery.com>
PR rtl-optimization/25514

View File

@ -0,0 +1,7 @@
// PR 27451
// { dg-do compile }
void foo()
{
asm("" ::: X); // { dg-error "before" }
}