diff options
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/gimplify.c | 5 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/pr18164.c | 7 |
4 files changed, 21 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9b2dba2..6e2afa3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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> diff --git a/gcc/gimplify.c b/gcc/gimplify.c index c6256fa..ecd4271 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 94174d9..78033c6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..1b3651e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr18164.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +void +f (void) +{ + int x; + asm ("" : "" (x)); /* {dg-error "output operand constraint lacks" } */ +} |
