Blame SOURCES/gcc34-pr8788.patch

6693b3
2005-05-08  Roger Sayle  <roger@eyesopen.com>
6693b3
6693b3
	PR inline-asm/8788
6693b3
	* stmt.c (expand_asm_operands): Avoid calling force_reg on BLKmode
6693b3
	operands.
6693b3
6693b3
	* gcc.dg/pr8788-1.c: New testcase.
6693b3
6693b3
--- gcc/stmt.c	(revision 99421)
6693b3
+++ gcc/stmt.c	(revision 99422)
6693b3
@@ -1703,7 +1703,7 @@ expand_asm_operands (tree string, tree o
6693b3
 
6693b3
       if (asm_operand_ok (op, constraint) <= 0)
6693b3
 	{
6693b3
-	  if (allows_reg)
6693b3
+	  if (allows_reg && TYPE_MODE (type) != BLKmode)
6693b3
 	    op = force_reg (TYPE_MODE (type), op);
6693b3
 	  else if (!allows_mem)
6693b3
 	    warning ("asm operand %d probably doesn't match constraints",
6693b3
--- gcc/testsuite/gcc.dg/pr8788-1.c	(revision 0)
6693b3
+++ gcc/testsuite/gcc.dg/pr8788-1.c	(revision 99422)
6693b3
@@ -0,0 +1,20 @@
6693b3
+/* PR inline-asm/8788 */
6693b3
+/* { dg-do compile } */
6693b3
+/* { dg-options "-O2" } */
6693b3
+
6693b3
+typedef struct {
6693b3
+    long x[6];
6693b3
+} myjmp_buf;
6693b3
+
6693b3
+typedef struct {
6693b3
+    myjmp_buf regs;
6693b3
+} my_stack;
6693b3
+
6693b3
+void switch_to_stack (my_stack *stack){
6693b3
+    asm (  /* { dg-error "impossible constraint" } */
6693b3
+/* { dg-warning "asm operand 1" "asm operand 1" { target *-*-* } 14 } */
6693b3
+        "\n"
6693b3
+        : "+r" (stack->regs)
6693b3
+    );
6693b3
+}
6693b3
+