Failure introduced by the sahf patch(es)

François-Xavier Coudert
Thu Mar 15 10:33:00 GMT 2007

> /utmp/coudert/gfortran/trunk/gcc/config/i386/ In function `output_26':
> /utmp/coudert/gfortran/trunk/gcc/config/i386/ error:
> `HAVE_AS_IX86_SAHF' undeclared (first use in this function)
> /utmp/coudert/gfortran/trunk/gcc/config/i386/ error: (Each
> undeclared identifier is reported only once
> /utmp/coudert/gfortran/trunk/gcc/config/i386/ error: for
> each function it appears in.)

Doh, I understand. insn-output.c contains:

static const char *
output_26 (rtx *operands ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED)
#line 991 "/utmp/coudert/gfortran/trunk/gcc/config/i386/"
 return HAVE_AS_IX86_SAHF ? "sahf" : ".byte\t0x9e";

but on my system, the assembler doesn't recognize sahf. Thus
HAVE_AS_IX86_SAHF is not defined. The above code should be changed
into a ifdef:

Index: gcc/config/i386/
--- gcc/config/i386/     (revision 122951)
+++ gcc/config/i386/     (working copy)
@@ -988,7 +988,11 @@
        (unspec:CC [(match_operand:HI 0 "register_operand" "a")]
-  "* return HAVE_AS_IX86_SAHF ? \"sahf\" : \".byte\t0x9e\";"
+  "* #ifdef HAVE_AS_IX86_SAHF
+       return \"sahf\";
+     #else
+       return \".byte\t0x9e\";
+     #endif"
   [(set_attr "length" "1")
    (set_attr "athlon_decode" "vector")
    (set_attr "amdfam10_decode" "direct")

I don't know if the patch above has the correct formatting for these
multiline strings, but it allows stage1 to complete.


More information about the Gcc-patches mailing list