]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/27451 (ICE with invalid asm statement)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Mon, 22 May 2006 16:53:38 +0000 (16:53 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Mon, 22 May 2006 16:53:38 +0000 (16:53 +0000)
PR c++/27451
* stmt.c (expand_asm_operands): Skip asm statement with erroneous
clobbers.

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

From-SVN: r113986

gcc/ChangeLog
gcc/stmt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/asm9.C [new file with mode: 0644]

index bcf3002df8682edb7a80ff76d0a7c939e22a2184..1aad6d82eda398374a8ef680dc37e9e46437da74 100644 (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-15  Roger Sayle  <roger@eyesopen.com>
 
        PR rtl-optimization/22563
index db36c699afd12fba888e130cdf12299c9d0e324a..5dd5e82d115f48c8297189db5b4a38c5f017e5dd 100644 (file)
@@ -664,7 +664,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)
index 0ed0913452cec7b000ce582a0122941a336122d9..fd9901b5e5f74be81bf4d467e4e4c5a54b1a40e0 100644 (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-15  Roger Sayle  <roger@eyesopen.com>
 
        PR middle-end/26729
diff --git a/gcc/testsuite/g++.dg/ext/asm9.C b/gcc/testsuite/g++.dg/ext/asm9.C
new file mode 100644 (file)
index 0000000..9daa01b
--- /dev/null
@@ -0,0 +1,7 @@
+// PR 27451
+// { dg-do compile }
+
+void foo()
+{
+  asm("" ::: X); // { dg-error "before" }
+}