Failure introduced by the sahf patch(es)

Philippe Schaffnit P.Schaffnit@access.rwth-aachen.de
Thu Mar 15 10:54:00 GMT 2007


Hi!

I might (or not!) be related to this: I am now seeing a build failure
under x86_64-unknown-linux-gnu with '122950' sources:

gcc   -g -fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition
-Wmissing-format-attribute -fno-common   -DHAVE_CONFIG_H
-DGENERATOR_FILE  -o build/genoutput \
    build/genoutput.o build/rtl.o build/read-rtl.o build/ggc-none.o
build/vec.o build/min-insn-modes.o build/gensupport.o build/print-rtl.o
build/errors.o ../build-x86_64-unknown-linux-gnu/libiberty/libiberty.a
build/genoutput /USER/philippe/Irix/Gcc_Sources/gcc/config/i386/i386.md
\
  insn-conditions.md > tmp-output.c
/bin/sh /USER/philippe/Irix/Gcc_Sources/gcc/../move-if-change
tmp-output.c insn-output.c
echo timestamp > s-output
gcc -c   -g -fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition
-Wmissing-format-attribute -fno-common   -DHAVE_CONFIG_H -I. -I.
-I/USER/philippe/Irix/Gcc_Sources/gcc
-I/USER/philippe/Irix/Gcc_Sources/gcc/.
-I/USER/philippe/Irix/Gcc_Sources/gcc/../include
-I/USER/philippe/Irix/Gcc_Sources/gcc/../libcpp/include
-I/WORK/philippe/Tools/Gmp/include -I/WORK/philippe/Tools/Mpfr/include
-I/USER/philippe/Irix/Gcc_Sources/gcc/../libdecnumber
-I../libdecnumber    insn-output.c -o insn-output.o
/USER/philippe/Irix/Gcc_Sources/gcc/config/i386/i386.md: In function
'output_26':
/USER/philippe/Irix/Gcc_Sources/gcc/config/i386/i386.md:991: error:
'HAVE_AS_IX86_SAHF' undeclared (first use in this function)
/USER/philippe/Irix/Gcc_Sources/gcc/config/i386/i386.md:991: error:
(Each undeclared identifier is reported only once
/USER/philippe/Irix/Gcc_Sources/gcc/config/i386/i386.md:991: error: for
each function it appears in.)
/USER/philippe/Irix/Gcc_Sources/gcc/config/i386/i386.md:992: warning:
control reaches end of non-void function
make[3]: *** [insn-output.o] Error 1
make[3]: Leaving directory `/WORK/philippe/Compilation/Gcc/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/WORK/philippe/Compilation/Gcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/WORK/philippe/Compilation/Gcc'
make: *** [bootstrap] Error 2

Thanks!

Philippe

Uros Bizjak wrote:
> 
> H. J. Lu wrote:
> 
> >>> There has been a recent addition to add this "sahf" to the
> >>> instructions used by the i386 back-end.
> >>>
> >> This is mine, but from asm dump:
> >>
> >> .L120:
> >>        fprem
> >>        fnstsw  %ax
> >>        sahf
> >>        jp      .L120
> >>        fstp    %st(1)
> >>        xorpd   %xmm2, %xmm2
> >>
> >> This is perfectly good asm for MOD() a.k.a. fmod() function.
> >>
> >
> > 64bit sahf was enabled by
> >
> > http://sourceware.org/ml/binutils/2004-11/msg00313.html
> >
> > I think we should either use .byte with a commment and check if
> > assembler supports 64bit sahf if we want to generate 64bit sahf.
> >
> Attached patch fixes this annoyance.
> 
> 2007-03-14  Uros Bizjak  <ubizjak@gmail.com>
> 
>         * configure.ac (HAVE_AS_IX86_SAHF): On x86 targets check whether
>         the configured assembler supports the sahf mnemonic.
>         * configure: Regenerate.
>         * config.in: Regenerate.
> 
>         * config/i386/i386.md (x86_sahf_1): Depending on HAVE_AS_IX86_SAHF,
>         emit "sahf" or ".byte\t0x9e" as asm template.
> 
> Patch is regression tested on x86_64-pc-linux-gnu for all default
> languages. Patch is commited to SVN.
> 
> Uros.
> 
>   ------------------------------------------------------------------------
> Index: config/i386/i386.md
> ===================================================================
> --- config/i386/i386.md (revision 122924)
> +++ config/i386/i386.md (working copy)
> @@ -988,7 +988,7 @@
>         (unspec:CC [(match_operand:HI 0 "register_operand" "a")]
>                    UNSPEC_SAHF))]
>    "TARGET_SAHF"
> -  "sahf"
> +  "* return HAVE_AS_IX86_SAHF ? \"sahf\" : \".byte\t0x9e\";"
>    [(set_attr "length" "1")
>     (set_attr "athlon_decode" "vector")
>     (set_attr "amdfam10_decode" "direct")
> Index: config.in
> ===================================================================
> --- config.in   (revision 122924)
> +++ config.in   (working copy)
> @@ -228,6 +228,12 @@
>  #endif
> 
> 
> +/* Define if your assembler supports the sahf mnemonic. */
> +#ifndef USED_FOR_TARGET
> +#undef HAVE_AS_IX86_SAHF
> +#endif
> +
> +
>  /* Define if your assembler supports the lituse_jsrdirect relocation. */
>  #ifndef USED_FOR_TARGET
>  #undef HAVE_AS_JSRDIRECT_RELOCS
> Index: configure
> ===================================================================
> --- configure   (revision 122924)
> +++ configure   (working copy)
> @@ -15237,6 +15237,39 @@
> 
>  fi
> 
> +    echo "$as_me:$LINENO: checking assembler for sahf mnemonic" >&5
> +echo $ECHO_N "checking assembler for sahf mnemonic... $ECHO_C" >&6
> +if test "${gcc_cv_as_ix86_sahf+set}" = set; then
> +  echo $ECHO_N "(cached) $ECHO_C" >&6
> +else
> +  gcc_cv_as_ix86_sahf=no
> +  if test x$gcc_cv_as != x; then
> +    echo 'sahf' > conftest.s
> +    if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'
> +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
> +  (eval $ac_try) 2>&5
> +  ac_status=$?
> +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
> +  (exit $ac_status); }; }
> +    then
> +       gcc_cv_as_ix86_sahf=yes
> +    else
> +      echo "configure: failed program was" >&5
> +      cat conftest.s >&5
> +    fi
> +    rm -f conftest.o conftest.s
> +  fi
> +fi
> +echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_sahf" >&5
> +echo "${ECHO_T}$gcc_cv_as_ix86_sahf" >&6
> +if test $gcc_cv_as_ix86_sahf = yes; then
> +
> +cat >>confdefs.h <<\_ACEOF
> +#define HAVE_AS_IX86_SAHF 1
> +_ACEOF
> +
> +fi
> +
>      echo "$as_me:$LINENO: checking assembler for different section symbol subtraction" >&5
>  echo $ECHO_N "checking assembler for different section symbol subtraction... $ECHO_C" >&6
>  if test "${gcc_cv_as_ix86_diff_sect_delta+set}" = set; then
> Index: configure.ac
> ===================================================================
> --- configure.ac        (revision 122924)
> +++ configure.ac        (working copy)
> @@ -2808,6 +2808,12 @@
>        [AC_DEFINE(HAVE_AS_IX86_FFREEP, 1,
>          [Define if your assembler supports the ffreep mnemonic.])])
> 
> +    gcc_GAS_CHECK_FEATURE([sahf mnemonic],
> +      gcc_cv_as_ix86_sahf,,,
> +      [sahf],,
> +      [AC_DEFINE(HAVE_AS_IX86_SAHF, 1,
> +        [Define if your assembler supports the sahf mnemonic.])])
> +
>      gcc_GAS_CHECK_FEATURE([different section symbol subtraction],
>        gcc_cv_as_ix86_diff_sect_delta,,,
>        [.section .rodata



More information about the Gcc-patches mailing list