OSDN Git Service

2005-01-18 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jan 2005 17:52:33 +0000 (17:52 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jan 2005 17:52:33 +0000 (17:52 +0000)
        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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93840 138bc75d-0d04-0410-961f-82ee72b054a4

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 396f7ce..0ca0d44 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 2b06502..f26e386 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 7301400..76e41b5 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 b34de19..2dc0cbb 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 634daa6..aef18d0 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);
+}