f77 on sco5 fails on GOTOFF references
Robert Lipe
robertl@dgii.com
Fri Jan 9 09:22:00 GMT 1998
> However, here's a hacky patch that works for the test case
>
> subroutine foo(a)
> double precision a
> a = dlog10(2.0d0)
> return
> end
>
> I've no idea if a similar change is required elsewhere as well.
Richard, your patch does indeed stop the assembler from hurling
on the fortran code that was sent to me that started this thread.
Since that code was meant to be a library fragment and I don't do
fortran, I have no way of testing that it actually executes correctly
for that specific case. I can, however, knock off a make check.
WARNING: apples and oranges test follows. I patched the 1225 snap
with your fix. As a reference, I include the output from the
same command on 1.0.1. I don't *believe* this will make any
difference. I could be wrong, but I thought that havinga baseline
for comparison was important.
make check-g77 RUNTESTFLAGS='--target_board unix{-melf} --tool_opts -fPIC'
First: the 1.0.1 unpatched results:
=== g77 tests ===
Running target unix/-melf
Using /usr/local/bin/../share/dejagnu/baseboards/unix.exp as board description f
ile for target.
Using /usr/local/bin/../share/dejagnu/config/unix.exp as generic interface file
for target.
Using /home/play/egcs-1.0/gcc/testsuite/config/default.exp as tool-and-target-sp
ecific interface file.
Running /home/play/egcs-1.0/gcc/testsuite/g77.f-torture/compile/compile.exp ...
FAIL: g77.f-torture/compile/alpha1.f, -O1
FAIL: g77.f-torture/compile/alpha1.f, -O2
FAIL: g77.f-torture/compile/alpha1.f, -O2 -fomit-frame-pointer -finline-functio
ns
Running /home/play/egcs-1.0/gcc/testsuite/g77.f-torture/execute/execute.exp ...
FAIL: g77.f-torture/execute/cabs.f compilation, -O0
FAIL: g77.f-torture/execute/cabs.f compilation, -O1
FAIL: g77.f-torture/execute/cabs.f compilation, -O2
FAIL: g77.f-torture/execute/cabs.f compilation, -O2 -fomit-frame-pointer -finli
ne-functions
FAIL: g77.f-torture/execute/claus.f compilation, -O0
FAIL: g77.f-torture/execute/claus.f compilation, -O1
FAIL: g77.f-torture/execute/claus.f compilation, -O2
FAIL: g77.f-torture/execute/claus.f compilation, -O2 -fomit-frame-pointer -finline-functions
FAIL: g77.f-torture/execute/complex_1.f compilation, -O0
FAIL: g77.f-torture/execute/complex_1.f compilation, -O1
FAIL: g77.f-torture/execute/complex_1.f compilation, -O2
FAIL: g77.f-torture/execute/complex_1.f compilation, -O2 -fomit-frame-pointer -
finline-functions
FAIL: g77.f-torture/execute/dcomplex.f compilation, -O0
FAIL: g77.f-torture/execute/dcomplex.f compilation, -O1
FAIL: g77.f-torture/execute/dcomplex.f compilation, -O2
FAIL: g77.f-torture/execute/dcomplex.f compilation, -O2 -fomit-frame-pointer -f
inline-functions
FAIL: g77.f-torture/execute/dnrm2.f compilation, -O0
FAIL: g77.f-torture/execute/dnrm2.f compilation, -O1
FAIL: g77.f-torture/execute/dnrm2.f compilation, -O2
FAIL: g77.f-torture/execute/dnrm2.f compilation, -O2 -fomit-frame-pointer -finl
ine-functions
FAIL: g77.f-torture/execute/dnrm2.f compilation, -O2 -fomit-frame-pointer -finl
ine-functions -funroll-loops
FAIL: g77.f-torture/execute/dnrm2.f compilation, -O2 -fomit-frame-pointer -finl
ine-functions -funroll-all-loops
FAIL: g77.f-torture/execute/erfc.f compilation, -O0
FAIL: g77.f-torture/execute/erfc.f compilation, -O1
FAIL: g77.f-torture/execute/erfc.f compilation, -O2
FAIL: g77.f-torture/execute/erfc.f compilation, -O2 -fomit-frame-pointer -finli
ne-functions
FAIL: g77.f-torture/execute/exp.f compilation, -O0
FAIL: g77.f-torture/execute/exp.f compilation, -O1
FAIL: g77.f-torture/execute/exp.f compilation, -O2
FAIL: g77.f-torture/execute/exp.f compilation, -O2 -fomit-frame-pointer -finlin
e-functions
FAIL: g77.f-torture/execute/le.f compilation, -O0
FAIL: g77.f-torture/execute/le.f compilation, -O1
FAIL: g77.f-torture/execute/short.f compilation, -O0
FAIL: g77.f-torture/execute/short.f compilation, -O1
FAIL: g77.f-torture/execute/short.f compilation, -O2
FAIL: g77.f-torture/execute/short.f compilation, -O2 -fomit-frame-pointer -finl
ine-functions
FAIL: g77.f-torture/execute/short.f compilation, -O2 -fomit-frame-pointer -finl
ine-functions -funroll-loops
FAIL: g77.f-torture/execute/short.f compilation, -O2 -fomit-frame-pointer -finl
ine-functions -funroll-all-loops
=== g77 Summary ===
# of expected passes 53
# of unexpected failures 41
# of untested testcases 38
/home/play/10/gcc/g77 version egcs-2.90.23 980102 (egcs-1.0.1 release)
Now the patched 1225 results:
FAIL: g77.f-torture/execute/cabs.f compilation, -O0
FAIL: g77.f-torture/execute/claus.f compilation, -O0
FAIL: g77.f-torture/execute/complex_1.f compilation, -O0
FAIL: g77.f-torture/execute/dcomplex.f compilation, -O0
FAIL: g77.f-torture/execute/dnrm2.f compilation, -O0
FAIL: g77.f-torture/execute/dnrm2.f execution, -O2 -fomit-frame-pointer -finlin
e-functions -funroll-loops
FAIL: g77.f-torture/execute/dnrm2.f execution, -O2 -fomit-frame-pointer -finlin
e-functions -funroll-all-loops
FAIL: g77.f-torture/execute/erfc.f compilation, -O0
FAIL: g77.f-torture/execute/exp.f compilation, -O0
FAIL: g77.f-torture/execute/le.f compilation, -O0
FAIL: g77.f-torture/execute/short.f compilation, -O0
=== g77 Summary ===
# of expected passes 112
# of unexpected failures 11
# of untested testcases 9
/home/play/negcs/gcc/g77 version egcs-2.91.03 971225 (gcc-2.8.0)
And, just as a sanity check to be sure that only the PIC stuff is
involved here:
$ make check-g77 RUNTESTFLAGS='--target_board unix{-melf} '
FAIL: g77.f-torture/execute/dnrm2.f execution, -O2 -fomit-frame-pointer -finlin
e-functions -funroll-loops
FAIL: g77.f-torture/execute/dnrm2.f execution, -O2 -fomit-frame-pointer -finlin
e-functions -funroll-all-loops
=== g77 Summary ===
# of expected passes 130
# of unexpected failures 2
/home/play/negcs/gcc/g77 version egcs-2.91.03 971225 (gcc-2.8.0)
dnrm2.f has always failed on this target, so let's throw that one out.
Of the ones that are still failing, they're all of the form:
/usr/tmp/cca002Lv.s:87:invalid operand combination: leal
Sure enough, the compiler is emitting things like:
leal .LC0@GOTOFF(%ebx),-76(%ebp)
Yes, this patch did indeed help things substantially, Richard. If
you'd like to take a shot at the leal voodoo as well, I can knock off
a build and a test for you.
Thank you for your help.
RJL
>
>
> r~
>
>
>
> Fri Jan 9 00:48:09 1998 Richard Henderson <rth@cygnus.com>
>
> * i386.md (push): Delete identical !TARGET_MOVE pattern. Add
> patterns to prohibit symbolic constants if flag_pic.
>
>
> Index: i386.md
> ===================================================================
> RCS file: /cvs/cvsfiles/egcs/gcc/config/i386/i386.md,v
> retrieving revision 1.4
> diff -u -p -d -r1.4 i386.md
> --- i386.md 1997/11/05 19:29:37 1.4
> +++ i386.md 1998/01/09 08:45:36
> @@ -835,7 +835,13 @@
> (define_insn ""
> [(set (match_operand:SI 0 "push_operand" "=<")
> (match_operand:SI 1 "general_operand" "g"))]
> - "TARGET_PUSH_MEMORY"
> + "TARGET_PUSH_MEMORY && !flag_pic"
> + "push%L0 %1")
> +
> +(define_insn ""
> + [(set (match_operand:SI 0 "push_operand" "=<")
> + (match_operand:SI 1 "general_operand" "rmn"))]
> + "TARGET_PUSH_MEMORY && flag_pic"
> "push%L0 %1")
>
> ;; If not a 386, it is faster to move MEM to a REG and then push, rather than
> @@ -844,13 +850,13 @@
> (define_insn ""
> [(set (match_operand:SI 0 "push_operand" "=<")
> (match_operand:SI 1 "nonmemory_operand" "ri"))]
> - "!TARGET_PUSH_MEMORY && TARGET_MOVE"
> + "!TARGET_PUSH_MEMORY && !flag_pic"
> "push%L0 %1")
>
> (define_insn ""
> [(set (match_operand:SI 0 "push_operand" "=<")
> - (match_operand:SI 1 "nonmemory_operand" "ri"))]
> - "!TARGET_PUSH_MEMORY && !TARGET_MOVE"
> + (match_operand:SI 1 "nonmemory_operand" "rn"))]
> + "!TARGET_PUSH_MEMORY && flag_pic"
> "push%L0 %1")
>
> ;; General case of fullword move.
>
>
--
Robert Lipe http://www.dgii.com/people/robertl robertl@dgii.com
More information about the Gcc
mailing list