[multiple changes]
authorAndrew Pinski <pinskia@physics.uc.edu>
Mon, 29 Nov 2004 02:21:28 +0000 (02:21 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Mon, 29 Nov 2004 02:21:28 +0000 (18:21 -0800)
2004-11-18  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/18164
        * gimplify.c (gimplify_asm_expr): If the length of an output operand
        is zero, do not process it, just let it go through.

2004-11-28  Andrew Pinski  <pinskia@physics.uc.edu>

        * gcc.dg/pr18164.c: New test.

From-SVN: r91459

gcc/ChangeLog
gcc/gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr18164.c [new file with mode: 0644]

index 9b2dba2458cdf94d922bcd5586e7b662d886b2c8..6e2afa3cc241dce31eeed7cf7fd2717b30fae29d 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-18  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR middle-end/18164
+       * gimplify.c (gimplify_asm_expr): If the length of an output operand
+       is zero, do not process it, just let it go through.
+
 2004-11-28  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
            Diego Novillo  <dnovillo@redhat.com>            
 
index c6256fa7ac7a2681c7d25c4f20ae6eb7eaca16e5..ecd42717f05cae4d990137c2d0ccf2c531e95236 100644 (file)
@@ -3120,8 +3120,12 @@ gimplify_asm_expr (tree *expr_p, tree *pre_p, tree *post_p)
   ret = GS_ALL_DONE;
   for (i = 0, link = ASM_OUTPUTS (expr); link; ++i, link = TREE_CHAIN (link))
     {
+      size_t constraint_len;
       oconstraints[i] = constraint
        = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
+      constraint_len = strlen (constraint);
+      if (constraint_len == 0)
+        continue;
 
       parse_output_constraint (&constraint, i, 0, 0,
                               &allows_mem, &allows_reg, &is_inout);
@@ -3145,7 +3149,6 @@ gimplify_asm_expr (tree *expr_p, tree *pre_p, tree *post_p)
             operands.  */
          tree input;
          char buf[10];
-         size_t constraint_len = strlen (constraint);
 
          /* Turn the in/out constraint into an output constraint.  */
          char *p = xstrdup (constraint);
index 94174d9725948bc29efcd95343d701f22f991fe6..78033c61b07f49d46d96897f8863f355454b6153 100644 (file)
@@ -1,3 +1,7 @@
+2004-11-28  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       * gcc.dg/pr18164.c: New test.
+
 2004-11-28  Matt Kraai  <kraai@alumni.cmu.edu>
 
        * gcc.dg/funroll-loops-all.c: New.
diff --git a/gcc/testsuite/gcc.dg/pr18164.c b/gcc/testsuite/gcc.dg/pr18164.c
new file mode 100644 (file)
index 0000000..1b3651e
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+void
+f (void)
+{
+  int x;
+  asm ("" :  "" (x)); /* {dg-error "output operand constraint lacks" } */
+}