target/10348: sparc64-sun-solaris2.7 testsuite failure in execute/20020720-1.c with -fpic/-fPIC
ghazi@caip.rutgers.edu
ghazi@caip.rutgers.edu
Tue Apr 8 14:56:00 GMT 2003
>Number: 10348
>Category: target
>Synopsis: sparc64-sun-solaris2.7 testsuite failure in execute/20020720-1.c with -fpic/-fPIC
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: pessimizes-code
>Submitter-Id: net
>Arrival-Date: Tue Apr 08 14:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Kaveh Ghazi
>Release: gcc version 3.3 20030408 (prerelease)
>Organization:
>Environment:
sparc64-sun-solaris2.7
>Description:
As noted here:
http://gcc.gnu.org/ml/gcc-testresults/2003-04/msg00483.html
I'm getting testsuite failures in execute/20020720-1.c on sparc64-sun-solaris2.7 at -O1 and above when adding -fpic or -fPIC to the testsuite pass. The logfile shows that the function `link_error' is still called, i.e. the call is not being optimized away like it should.
>How-To-Repeat:
Target sparc64-sun-solaris2.7 and compile 20020720-1.i with:
cc1 -fpreprocessed 20020720-1.i -quiet -dumpbase 20020720-1.c -auxbase 20020720-1 -O -version -fpic -o 20020720-1.s
If you grep for `link_error' in the .s file you'll see it's still being called. If you take out -fpic, the optimization succeeds.
# 1 "20020720-1.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "20020720-1.c"
extern void abort (void);
extern double fabs (double);
extern void link_error (void);
void
foo (double x)
{
double p, q;
p = fabs (x);
q = 0.0;
if (p < q)
link_error ();
}
int
main()
{
foo (1.0);
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-prs
mailing list