This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Failure introduced by the sahf patch(es)


/utmp/coudert/gfortran/trunk/gcc/config/i386/i386.md: In function `output_26':
/utmp/coudert/gfortran/trunk/gcc/config/i386/i386.md:991: error:
`HAVE_AS_IX86_SAHF' undeclared (first use in this function)
/utmp/coudert/gfortran/trunk/gcc/config/i386/i386.md:991: error: (Each
undeclared identifier is reported only once
/utmp/coudert/gfortran/trunk/gcc/config/i386/i386.md:991: 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/i386.md"
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/i386.md
===================================================================
--- gcc/config/i386/i386.md     (revision 122951)
+++ gcc/config/i386/i386.md     (working copy)
@@ -988,7 +988,11 @@
       (unspec:CC [(match_operand:HI 0 "register_operand" "a")]
                  UNSPEC_SAHF))]
  "TARGET_SAHF"
-  "* 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.

FX


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]