optimization/2107: followup to 2072 -- bug details discovered (SPARC, PIC)
eljay@adobe.com
eljay@adobe.com
Mon Feb 26 14:56:00 GMT 2001
>Number: 2107
>Category: optimization
>Synopsis: followup to 2072 -- bug details discovered (SPARC, PIC)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Mon Feb 26 14:56:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: John Love-Jensen
>Release: GCC 2.95.2
>Organization:
>Environment:
Solaris 2.6, 7, 8 and GCC 2.95.2
>Description:
The -fschedule-insns messes up when used with -fPIC (and
-fpic).
It can cause the _GLOBAL_OFFSET_TABLE_ to be loaded into
%l7 AFTER it is used, through it's optimization.
Especially noticable when used with explicit inline
functions or -finline-functions (pro-active inlining).
Thus the "-O3" switch mentioned in #2091, which enables
-finline-functions.
>How-To-Repeat:
gcc -O1 -fPIC -fschedule-insns -save-temps -c spaz.cpp
(-O0 -fPIC -fschedule-insns doesn't cause the behavior.)
See GNAT#2091 for an attachment with a code snippet.
>Fix:
-fno-schedule-insns cures the bug. (Only pertinent when the
code must be -fPIC or -fpic, such as with a shared library,
and probably only on System V ABI SPARC code.)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list