http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45912
Summary: [4.6 regression] Patch for PR tree-optimization/44972
caused 2500+ FAILs on Solaris 2/SPARC
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: major
Priority: P3
Component: tree-optimization
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Host: sparc-sun-solaris2.*
Target: sparc-sun-solaris2.*
Build: sparc-sun-solaris2.*
Created attachment 21973
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=21973
stage1 assembler output
The Solaris 2/SPARC port (probably every SPARC port) is in a terrible state
with
2500+ execution failures in the testsuite (mostly 64-bit).
A reghunt revealed that this was introduced by this patch:
2010-09-10 Martin Jambor <[email protected]>
PR tree-optimization/44972
* tree-sra.c: Include toplev.h.
(build_ref_for_offset): Entirely reimplemented.
(build_ref_for_model): New function.
(build_user_friendly_ref_for_offset): New function.
(analyze_access_subtree): Removed build_ref_for_offset check.
(propagate_subaccesses_across_link): Likewise.
(create_artificial_child_access): Use
build_user_friendly_ref_for_offset.
[...]
The reghunt proved difficult because originally the tree didn't build due to
PR tree-optimization/45611 (fixed in r164244) and PR bootstrap/45630 (fixed in
r164163). The problem is a miscompilation since it doesn't occur with the
stage1
compiler.
I've used the -O2 compilation of gcc.c-torture/execute/20000706-5.c as the
testcase during the reghunt. It can be compiled with
% cc1 20000706-5.c -mptr64 -mstack-bias -mno-v8plus -mcpu=v9 -quiet -m64 -O2 -w
I'm attaching the stage1 and stage3 .s files for comparison. The test SEGVs
here:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x000000010000098c in main ()
1: x/i $pc
=> 0x10000098c <main+36>: st %g3, [ %g4 + %g2 ]
(gdb) p/x $g4+$g2
$3 = 0x37ffff1d8
The target address is unmapped in the process, as can be seen with pmap:
19505: /var/gcc/reghunt/102852/gcc/testsuite/gcc/stage3/20000706-5.x2
0000000100000000 8K r-x--
/var/gcc/reghunt/102852/gcc/testsuite/gcc/stage3/20000706-5.x2
0000000100100000 8K rwx--
/var/gcc/reghunt/102852/gcc/testsuite/gcc/stage3/20000706-5.x2
FFFFFFFF7F100000 1216K r-x-- /lib/sparcv9/libc.so.1
FFFFFFFF7F230000 48K r-x-- /lib/sparcv9/libc.so.1
FFFFFFFF7F300000 24K rwx-- [ anon ]
FFFFFFFF7F33C000 72K rwx-- /lib/sparcv9/libc.so.1
FFFFFFFF7F34E000 8K rwx-- /lib/sparcv9/libc.so.1
FFFFFFFF7F400000 640K r-x-- /lib/sparcv9/libm.so.2
FFFFFFFF7F500000 8K rwx-- [ anon ]
FFFFFFFF7F59E000 40K rwx-- /lib/sparcv9/libm.so.2
FFFFFFFF7F600000 64K r-x-- /lib/sparcv9/ld.so.1
FFFFFFFF7F610000 64K r-x-- /lib/sparcv9/ld.so.1
FFFFFFFF7F620000 64K r-x-- /lib/sparcv9/ld.so.1
FFFFFFFF7F630000 24K r-x-- /lib/sparcv9/ld.so.1
FFFFFFFF7F700000 64K rwx-- [ anon ]
FFFFFFFF7F736000 16K rwx-- /lib/sparcv9/ld.so.1
FFFFFFFF7F73A000 8K rwx-- /lib/sparcv9/ld.so.1
FFFFFFFF7FFF0000 64K rw--- [ stack ]
total 2440K
Please fix asap; it is almost impossible to do any useful work on a port that
broken.
Thanks.
Rainer