internal error asm
Jeffrey A Law
law@cygnus.com
Tue Feb 24 05:07:00 GMT 1998
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];
More information about the Gcc
mailing list