This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: internal error asm
- To: drepper at cygnus dot com (Ulrich Drepper)
- Subject: Re: internal error asm
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Tue, 24 Feb 1998 00:31:59 -0700
- cc: egcs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <r2iuq6ggb9.fsf@happy.cygnus.com>you write:
> Hi,
>
> the following little piece of code crashed all gcc versions on ix86
> which I could test:
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> #include <stdio.h>
>
> extern double bar (double);
>
> int
> baz (double d)
> {
> double e = bar (d);
> #ifdef BROKEN
> asm volatile ("" : : : "st");
> #else
> asm volatile ("" : : : "memory");
> #endif
> return printf ("%lg\n", e);
> }
Thanks. It's an x86 specific failure (dies in reg-stack...)
Can you test this patch (both to make sure it fixes the abort *and*
that it doesn't obviously screw up the code -- there's some question
in my mind about what is the proper thing to do in this case.
Index: reg-stack.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/./gcc/reg-stack.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 reg-stack.c
*** reg-stack.c 1998/02/13 05:40:28 1.8
--- reg-stack.c 1998/02/24 07:28:42
*************** constrain_asm_operands (n_operands, oper
*** 605,610 ****
--- 605,615 ----
int n_alternatives;
int j;
+ /* If the ASM has no operands, then it must either be alternative zero
+ or "-1" for no alternative matches. ??? Which is correct? */
+ if (n_operands == 0)
+ return 0;
+
for (j = 0; j < n_operands; j++)
constraints[j] = operand_constraints[j];