re PR c/19472 (compiler internal error: in var_ann, at tree-flow-inline.h:34)
authorAndrew Pinski <pinskia@physics.uc.edu>
Tue, 18 Jan 2005 17:52:33 +0000 (17:52 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Tue, 18 Jan 2005 17:52:33 +0000 (09:52 -0800)
2005-01-18  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c/19472
        * semantics.c (finish_asm_stmt): Strip nops off
        input memory operands.

2005-01-18  Andrew Pinski  <pinskia@physics.uc.edu>

        PR C/19472
        * c-typeck.c (build_asm_expr): Strip nops off
        input memory operands.

2005-01-18  Andrew Pinski  <pinskia@physics.uc.edu>

        PR C/19472
        * gcc.dg/asm-a.c: New test.

From-SVN: r93840

gcc/ChangeLog
gcc/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/asm-a.c [new file with mode: 0644]

index 396f7ce96e46357f9f020db8428a056788e7a6e1..0ca0d444afba3a122be1ab6996144f6ffd9ceee7 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-18  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR C/19472
+       * c-typeck.c (build_asm_expr): Strip nops off
+       input memory operands.
+
 2005-01-18  David Edelsohn  <edelsohn@gnu.org>
 
        * config/rs6000/aix43.h (CPLUSPLUS_CPP_SPEC): Delete
index 2b065023aa5d195fe3109d640a44fc18012e598b..f26e3868813479416a92a384a0c0ac30ce828ede 100644 (file)
@@ -6335,8 +6335,14 @@ build_asm_expr (tree string, tree outputs, tree inputs, tree clobbers,
        {
          /* If the operand is going to end up in memory,
             mark it addressable.  */
-         if (!allows_reg && allows_mem && !c_mark_addressable (input))
-           input = error_mark_node;
+         if (!allows_reg && allows_mem)
+           {
+             /* Strip the nops as we allow this case.  FIXME, this really
+                should be rejected or made deprecated.  */
+             STRIP_NOPS (input);
+             if (!c_mark_addressable (input))
+               input = error_mark_node;
+         }
        }
       else
        input = error_mark_node;
index 7301400fc5b991451deb172fbb64b9fc2e384c54..76e41b5e305061e9a81f1445dfc653562e9e1804 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-18  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR c/19472
+       * semantics.c (finish_asm_stmt): Strip nops off
+       input memory operands.
+
 2005-01-18  Kazu Hirata  <kazu@cs.umass.edu>
 
        * Make-lang.in, call.c, cvt.c, init.c, rtti.c, tree.c,
index b34de199adb045bf66f99983bf79fbd229d2644a..2dc0cbb9ff023d7ede33eae4700e9587b6f896ec 100644 (file)
@@ -1206,8 +1206,14 @@ finish_asm_stmt (int volatile_p, tree string, tree output_operands,
            {
              /* If the operand is going to end up in memory,
                 mark it addressable.  */
-             if (!allows_reg && allows_mem && !cxx_mark_addressable (operand))
-               operand = error_mark_node;
+             if (!allows_reg && allows_mem)
+               {
+                 /* Strip the nops as we allow this case.  FIXME, this really
+                    should be rejected or made deprecated.  */
+                 STRIP_NOPS (operand);
+                 if (!cxx_mark_addressable (operand))
+                   operand = error_mark_node;
+               }
            }
          else
            operand = error_mark_node;
index 634daa65a2b165f65b93306af49638d68cd486c4..aef18d056f69f2d0e67107b01548907b0a85201a 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-18  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR c/19472
+       * gcc.dg/asm-a.c: New test.
+
 2005-01-18  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        * gcc.dg/sh-relax.c: Add prototype for abort.
diff --git a/gcc/testsuite/gcc.dg/asm-a.c b/gcc/testsuite/gcc.dg/asm-a.c
new file mode 100644 (file)
index 0000000..aca2d4e
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2" } */
+
+/* The problem was we were not striping the long cast here.
+   Note this really should be invalid code but not for the
+   current release (4.0) as we have people using it.  */
+
+void blockCopy_MMX2(int*);
+void postProcess_MMX2()
+{
+  int c, x,y, width;
+  asm( "" :: "m" ((long)x));
+  blockCopy_MMX2(&c);
+}