[Bug target/43729] Mach-O LTO support needed for darwin

2010-07-17 Thread steven at gcc dot gnu dot org


--- Comment #54 from steven at gcc dot gnu dot org  2010-07-17 22:55 ---
FIXED in r162047.


-- 

steven at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-06-14 Thread howarth at nitro dot med dot uc dot edu


--- Comment #53 from howarth at nitro dot med dot uc dot edu  2010-06-14 
13:14 ---
Now that r160722, the COFF lto patches, are committed to gcc 4.5 branch, we are
clear to backport r159173 as well for the mach-o patches. I've done this
locally and posted the testsuite results at
http://gcc.gnu.org/ml/gcc-testresults/2010-06/msg01280.html. These can be
improved by backporting the testsuite changes from r159700, r159924 and r159837
to gcc 4.5 branch as well.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-06-06 Thread dominiq at lps dot ens dot fr


--- Comment #50 from dominiq at lps dot ens dot fr  2010-06-06 10:50 ---
On x86_64-apple-darwin10.3.0 between revisions 160235 and 160330 the failures
with -m32 went from

FAIL: gcc.c-torture/execute/builtins/abs-1.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/memcpy-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/memmove-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/mempcpy-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/memset-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/pr23484-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/snprintf-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/sprintf-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/stpcpy-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/strcat-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/strcpy-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/strncat-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/strncpy-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/strstr-asm.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/vsnprintf-chk.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/vsprintf-chk.c compilation,  -O2 -fwhopr 

to

FAIL: gcc.c-torture/execute/builtins/abs-1.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/strstr-asm.c compilation,  -O2 -fwhopr 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-06-06 Thread dominiq at lps dot ens dot fr


--- Comment #51 from dominiq at lps dot ens dot fr  2010-06-06 13:46 ---
The 14 tests were fixed by revision 160258 (that has nothing to do with
darwin).
Also I see the following changes, 160257:

=== gcc tests ===

Schedule of variations:
unix/-m32
unix/-m64

Running target unix/-m32
Using /sw64/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw64/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/p_work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/p_work/gcc/testsuite/gcc.dg/lto/lto.exp ...
FAIL: gcc.dg/lto/2008 c_lto_2008_0.o-c_lto_2008_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/2008 c_lto_2008_0.o-c_lto_2008_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20081112 c_lto_20081112_0.o-c_lto_20081112_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20081112 c_lto_20081112_0.o-c_lto_20081112_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090210 c_lto_20090210_0.o-c_lto_20090210_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20090210 c_lto_20090210_0.o-c_lto_20090210_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090213 c_lto_20090213_0.o-c_lto_20090213_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090218 c_lto_20090218_0.o-c_lto_20090218_3.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20100227-1 c_lto_20100227-1_0.o-c_lto_20100227-1_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20100227-1 c_lto_20100227-1_0.o-c_lto_20100227-1_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20100423-2 c_lto_20100423-2_0.o-c_lto_20100423-2_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20100423-2 c_lto_20100423-2_0.o-c_lto_20100423-2_1.o link, -O3
-fwhopr
FAIL: gcc.dg/lto/20100603-2 c_lto_20100603-2_0.o-c_lto_20100603-2_0.o link, -O0
-fwhopr (internal compiler error)
FAIL: gcc.dg/lto/20100603-2 c_lto_20100603-2_0.o-c_lto_20100603-2_0.o link, -O2
-fwhopr (internal compiler error)
FAIL: gcc.dg/lto/20100603-3 c_lto_20100603-3_0.o-c_lto_20100603-3_0.o link, -O0
-fwhopr (internal compiler error)
FAIL: gcc.dg/lto/20100603-3 c_lto_20100603-3_0.o-c_lto_20100603-3_0.o link, -O2
-fwhopr (internal compiler error)
FAIL: gcc.dg/lto/ipacp c_lto_ipacp_0.o-c_lto_ipacp_1.o link,  -O1 -fwhopr
-fipa-cp -fipa-cp-clone
FAIL: gcc.dg/lto/ipareference2 c_lto_ipareference2_0.o-c_lto_ipareference2_1.o
link,  -O1 -fwhopr -fwhole-program
FAIL: gcc.dg/lto/ipareference c_lto_ipareference_0.o-c_lto_ipareference_1.o
link,  -O1 -fwhopr 
FAIL: gcc.dg/lto/materialize-1 c_lto_materialize-1_0.o-c_lto_materialize-1_1.o
link,  -O3 -fwhopr

=== gcc Summary for unix/-m32 ===

# of expected passes520
# of unexpected failures20
# of unresolved testcases   20
# of unsupported tests  4
Running target unix/-m64
Using /sw64/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw64/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/p_work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/p_work/gcc/testsuite/gcc.dg/lto/lto.exp ...
FAIL: gcc.dg/lto/20090210 c_lto_20090210_0.o-c_lto_20090210_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20090210 c_lto_20090210_0.o-c_lto_20090210_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20100603-2 c_lto_20100603-2_0.o-c_lto_20100603-2_0.o link, -O0
-fwhopr (internal compiler error)
FAIL: gcc.dg/lto/20100603-2 c_lto_20100603-2_0.o-c_lto_20100603-2_0.o link, -O2
-fwhopr (internal compiler error)
FAIL: gcc.dg/lto/20100603-3 c_lto_20100603-3_0.o-c_lto_20100603-3_0.o link, -O0
-fwhopr (internal compiler error)
FAIL: gcc.dg/lto/20100603-3 c_lto_20100603-3_0.o-c_lto_20100603-3_0.o link, -O2
-fwhopr (internal compiler error)

=== gcc Summary for unix/-m64 ===

# of expected passes544
# of unexpected failures6
# of unresolved testcases   6
# of unsupported tests  4

=== gcc Summary ===

# of expected passes1064
# of unexpected failures26
# of unresolved testcases   26
# of unsupported tests  8

r160258:

=== gcc tests ===

Schedule of variations:
unix/-m32
unix/-m64

Running target unix/-m32
Using /sw64/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw64/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/p_work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/p_work/gcc/testsuite/gcc.dg/lto/lto.exp ...
FAIL: gcc.dg/lto/2008 c_lto_2008_0.o-c_lto_2008_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/2008 c_lto_2008_0.o-c_lto_2008_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20081112 c_lto_20081112_0.o-c_lto_20081112_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090213 c_lto_20090213_0.o-c_lto_20090213_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090218 c_lto_20090218_0.o-c_lto_20090218_3.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090717 c_lto_20090717_0.o-c_lto_20090717_1.o link, -O0
-fwhopr
FAIL: 

[Bug target/43729] Mach-O LTO support needed for darwin

2010-06-06 Thread dominiq at lps dot ens dot fr


--- Comment #52 from dominiq at lps dot ens dot fr  2010-06-06 20:23 ---
On powerpc-apple-darwin9 I see a similar improvement at revision 160335:

=== gcc tests ===

Schedule of variations:
unix/-m32
unix/-m64

Running target unix/-m32
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/gcc-4.6-work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running
/opt/gcc/gcc-4.6-work/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
...
FAIL: gcc.c-torture/execute/builtins/abs-1.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/strstr-asm.c compilation,  -O2 -fwhopr 

=== gcc Summary for unix/-m32 ===

# of expected passes900
# of unexpected failures2
# of unresolved testcases   2
Running target unix/-m64
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/gcc-4.6-work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running
/opt/gcc/gcc-4.6-work/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
...
FAIL: gcc.c-torture/execute/builtins/abs-1.c compilation,  -O2 -fwhopr 
FAIL: gcc.c-torture/execute/builtins/strstr-asm.c compilation,  -O2 -fwhopr 

=== gcc Summary for unix/-m64 ===

# of expected passes900
# of unexpected failures2
# of unresolved testcases   2

=== gcc Summary ===

# of expected passes1800
# of unexpected failures4
# of unresolved testcases   4

=== gcc tests ===

Schedule of variations:
unix/-m32
unix/-m64

Running target unix/-m32
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/gcc-4.6-work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/gcc-4.6-work/gcc/testsuite/gcc.dg/lto/lto.exp ...
FAIL: gcc.dg/lto/2008 c_lto_2008_0.o-c_lto_2008_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/2008 c_lto_2008_0.o-c_lto_2008_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20081112 c_lto_20081112_0.o-c_lto_20081112_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090213 c_lto_20090213_0.o-c_lto_20090213_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090218 c_lto_20090218_0.o-c_lto_20090218_3.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090717 c_lto_20090717_0.o-c_lto_20090717_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20090717 c_lto_20090717_0.o-c_lto_20090717_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20091005-1 c_lto_20091005-1_0.o-c_lto_20091005-1_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20100227-1 c_lto_20100227-1_0.o-c_lto_20100227-1_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20100227-1 c_lto_20100227-1_0.o-c_lto_20100227-1_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20100518 c_lto_20100518_0.o assemble, -O0 -fwhopr
FAIL: gcc.dg/lto/20100518 c_lto_20100518_0.o assemble, -O2 -fwhopr
FAIL: gcc.dg/lto/20100518 c_lto_20100518_0.o assemble, -O0 -flto
FAIL: gcc.dg/lto/20100518 c_lto_20100518_0.o assemble, -O2 -flto
FAIL: gcc.dg/lto/ipacp c_lto_ipacp_0.o-c_lto_ipacp_1.o link,  -O1 -fwhopr
-fipa-cp -fipa-cp-clone
FAIL: gcc.dg/lto/ipareference2 c_lto_ipareference2_0.o-c_lto_ipareference2_1.o
link,  -O1 -fwhopr -fwhole-program
FAIL: gcc.dg/lto/materialize-1 c_lto_materialize-1_0.o-c_lto_materialize-1_1.o
link,  -O3 -fwhopr

=== gcc Summary for unix/-m32 ===

# of expected passes516
# of unexpected failures17
# of unresolved testcases   21
# of unsupported tests  6
Running target unix/-m64
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/gcc-4.6-work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/gcc-4.6-work/gcc/testsuite/gcc.dg/lto/lto.exp ...
FAIL: gcc.dg/lto/2008 c_lto_2008_0.o-c_lto_2008_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/2008 c_lto_2008_0.o-c_lto_2008_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20081112 c_lto_20081112_0.o-c_lto_20081112_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090116 c_lto_20090116_0.o-c_lto_20090116_0.o link, -O1
-fwhopr -fPIC (internal compiler error)
FAIL: gcc.dg/lto/20090213 c_lto_20090213_0.o-c_lto_20090213_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090218 c_lto_20090218_0.o-c_lto_20090218_3.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20090717 c_lto_20090717_0.o-c_lto_20090717_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20090717 c_lto_20090717_0.o-c_lto_20090717_1.o link, -O2
-fwhopr
FAIL: gcc.dg/lto/20091005-1 c_lto_20091005-1_0.o-c_lto_20091005-1_1.o link, -O0
-fwhopr
FAIL: gcc.dg/lto/20100227-1 

[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-24 Thread mrs at gcc dot gnu dot org


--- Comment #49 from mrs at gcc dot gnu dot org  2010-05-25 00:29 ---
r159527 has yet more lto work in it.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-08 Thread howarth at nitro dot med dot uc dot edu


--- Comment #44 from howarth at nitro dot med dot uc dot edu  2010-05-08 
14:36 ---
Created an attachment (id=20604)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20604action=view)
example failing test case on powerpc-apple-darwin9


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-08 Thread howarth at nitro dot med dot uc dot edu


--- Comment #45 from howarth at nitro dot med dot uc dot edu  2010-05-08 
14:39 ---
Attached example failing testcase from lto.exp when using proposed patch from
http://gcc.gnu.org/ml/gcc-patches/2010-05/msg00577.html on
powerpc-apple-darwin9.  In this testcase, the failure appears as...
/Users/howarth/darwin_objdir/gcc/xgcc -B/Users/howarth/darwin_objdir/gcc/
--save-temps -O0 -fwhopr -c -o c_lto_2008_0.o /
Users/howarth/gcc/gcc/testsuite/gcc.dg/lto/2008_0.c
/Users/howarth/darwin_objdir/gcc/xgcc -B/Users/howarth/darwin_objdir/gcc/
--save-temps -O0 -fwhopr -c -o c_lto_2008_0.o /
Users/howarth/gcc/gcc/testsuite/gcc.dg/lto/2008_0.c
 /Users/howarth/darwin_objdir/gcc/xgcc -B/Users/howarth/darwin_objdir/gcc/
c_lto_2008_0.o c_lto_2008_1.o -v --save-te
mps -O0 -fwhopr   -o gcc-dg-lto-2008-01
Reading specs from /Users/howarth/darwin_objdir/gcc/specs
COLLECT_GCC=/Users/howarth/darwin_objdir/gcc/xgcc
COLLECT_LTO_WRAPPER=/Users/howarth/darwin_objdir/gcc/lto-wrapper
Target: powerpc-apple-darwin9.8.0
Configured with: ../gcc/configure --prefix=/Users/howarth/dist
--enable-languages=c --with-gmp=/sw --with-libiconv-prefix=/sw
 --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/l
ib --enable-lto --disable-bootstrap --enable-checking
Thread model: posix
gcc version 4.6.0 20100508 (experimental) (GCC) 
COMPILER_PATH=/Users/howarth/darwin_objdir/gcc/
LIBRARY_PATH=/Users/howarth/darwin_objdir/gcc/:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.5.8'
'-B/Users/howarth/darwin_objdir/gcc/' '-v' '-save-temps' '-O0' '-fwhopr' '-
o' 'gcc-dg-lto-2008-01'
 /Users/howarth/darwin_objdir/gcc/collect2 -dynamic -arch ppc
-macosx_version_min 10.5.8 -weak_reference_mismatches non-weak 
-o gcc-dg-lto-2008-01 -lcrt1.10.5.o -L/Users/howarth/darwin_objdir/gcc
c_lto_2008_0.o c_lto_2008_1.o -fwhopr -lgc
c_s.10.5 -lgcc_ext.10.5 -lgcc -lSystemStubs -lSystem
collect2 version 4.6.0 20100508 (experimental) (Darwin/PowerPC)
/Users/howarth/darwin_objdir/gcc/collect-ld -dynamic -arch ppc
-macosx_version_min 10.5.8 -weak_reference_mismatches non-weak
 -o gcc-dg-lto-2008-01 -lcrt1.10.5.o -L/Users/howarth/darwin_objdir/gcc
c_lto_2008_0.o c_lto_2008_1.o -lgcc_s.10.
5 -lgcc_ext.10.5 -lgcc -lSystemStubs -lSystem
 /sw/bin/gnm -n c_lto_2008_0.o
 /sw/bin/gnm -n c_lto_2008_1.o
/Users/howarth/darwin_objdir/gcc/lto-wrapper
/Users/howarth/darwin_objdir/gcc/xgcc -mmacosx-version-min=10.5.8
-B/Users/howar
th/darwin_objdir/gcc/ -v -save-temps -O0 -fwhopr -o gcc-dg-lto-2008-01
c_lto_2008_0.o c_lto_2008_1.o
Reading specs from /Users/howarth/darwin_objdir/gcc/specs
COLLECT_GCC=/Users/howarth/darwin_objdir/gcc/xgcc
COLLECT_LTO_WRAPPER=/Users/howarth/darwin_objdir/gcc/lto-wrapper
Target: powerpc-apple-darwin9.8.0
Configured with: ../gcc/configure --prefix=/Users/howarth/dist
--enable-languages=c --with-gmp=/sw --with-libiconv-prefix=/sw
 --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/l
ib --enable-lto --disable-bootstrap --enable-checking
Thread model: posix
gcc version 4.6.0 20100508 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-combine' '-c'
'-fltrans-output-list=/var/tmp//ccebD29J.ltrans.out' '-fwpa'
'-mmacosx-version-min=10.5.8
' '-B/Users/howarth/darwin_objdir/gcc/' '-v' '-save-temps' '-O0' '-dumpbase'
'gcc-dg-lto-2008-01' '-dumpdir' 'c_lto_20081
111_0.o'
 /Users/howarth/darwin_objdir/gcc/lto1 -fPIC -quiet -dumpbase
gcc-dg-lto-2008-01 -dumpdir c_lto_2008_0.o -mmacosx-ver
sion-min=10.5.8 -auxbase c_lto_2008_1 -O0 -version
-fltrans-output-list=/var/tmp//ccebD29J.ltrans.out -fwpa @/var/tmp//cc
LYFBxO
GNU GIMPLE (GCC) version 4.6.0 20100508 (experimental)
(powerpc-apple-darwin9.8.0)
compiled by GNU C version 4.0.1 (Apple Inc. build 5493), GMP version
4.3.1, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU GIMPLE (GCC) version 4.6.0 20100508 (experimental)
(powerpc-apple-darwin9.8.0)
compiled by GNU C version 4.0.1 (Apple Inc. build 5493), GMP version
4.3.1, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
COMPILER_PATH=/Users/howarth/darwin_objdir/gcc/:/Users/howarth/darwin_objdir/gcc/
LIBRARY_PATH=/Users/howarth/darwin_objdir/gcc/:/Users/howarth/darwin_objdir/gcc/:/usr/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-combine' '-c'
'-fltrans-output-list=/var/tmp//ccebD29J.ltrans.out' '-fwpa'
'-mmacosx-version-min=10.5.8
' '-B/Users/howarth/darwin_objdir/gcc/' '-v' '-save-temps' '-O0' '-dumpbase'
'gcc-dg-lto-2008-01' '-dumpdir' 'c_lto_20081
111_0.o'
COLLECT_GCC_OPTIONS='-combine' '-c'
'-fltrans-output-list=/var/tmp//ccebD29J.ltrans.out' '-fwpa'
'-mmacosx-version-min=10.5.8
' '-B/Users/howarth/darwin_objdir/gcc/' '-v' '-save-temps' '-O0' '-dumpbase'
'gcc-dg-lto-2008-01' '-dumpdir' 

[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-08 Thread howarth at nitro dot med dot uc dot edu


--- Comment #46 from howarth at nitro dot med dot uc dot edu  2010-05-08 
14:55 ---
Opps. The second compile in the failing example failing testcase was...

/Users/howarth/darwin_objdir/gcc/xgcc -B/Users/howarth/darwin_objdir/gcc/
--save-temps -O0 -fwhopr  -c  -o c_lto_2008_1.o
/Users/howarth/gcc/gcc/testsuite/gcc.dg/lto/2008_1.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-08 Thread howarth at nitro dot med dot uc dot edu


--- Comment #47 from howarth at nitro dot med dot uc dot edu  2010-05-08 
20:08 ---
Trying...

make -k check-gcc RUNTESTFLAGS=lto.exp --target_board=unix'{-m64}'

I get...

=== gcc Summary ===

# of expected passes319
# of unexpected failures73
# of unresolved testcases   155
# of unsupported tests  5
/Users/howarth/darwin_objdir/gcc/xgcc  version 4.6.0 20100508 (experimental)
(GCC) 

on powerpc-apple-darwin9. Interestingly most of these failures seem to be due
to 'main' getting optimized away...

/Users/howarth/darwin_objdir/gcc/collect-ld -dynamic -arch ppc
-macosx_version_min 10.5.8 -weak_reference_mismatches non-weak -o gcc-dg-lto-2
008-01 -lcrt1.10.5.o -L/Users/howarth/darwin_objdir/gcc
c_lto_2008_1.wpa.ltrans.o -lgcc_s.10.5 -lgcc_ext.10.5 -lgcc -lSystemStubs
-lS
ystem
Undefined symbols:
  _main, referenced from:
  start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

I am uploading one of these failing test cases as no_main.tgz.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-08 Thread howarth at nitro dot med dot uc dot edu


--- Comment #48 from howarth at nitro dot med dot uc dot edu  2010-05-08 
20:14 ---
Created an attachment (id=20607)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20607action=view)
example failing test case at -m64  on powerpc-apple-darwin9


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-07 Thread steven at gcc dot gnu dot org


--- Comment #43 from steven at gcc dot gnu dot org  2010-05-07 22:23 ---
FIXED for x86_64-apple-darwin:
http://gcc.gnu.org/viewcvs?view=revisionrevision=159173

ix86 and ppc* are still to be done.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-04 Thread mrs at gcc dot gnu dot org


--- Comment #42 from mrs at gcc dot gnu dot org  2010-05-04 08:22 ---
Steve, machopic_symbol_defined_p I think is being asked if that symbol is being
defined.  It is saying yes, but is isn't defined.  Since it was not defined
before, but is with LTO, I was assuming it was a symbol added by LTO.  Anyway,
machopic_indirection_name is the routine that creates the funny names.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-03 Thread mrs at gcc dot gnu dot org


--- Comment #37 from mrs at gcc dot gnu dot org  2010-05-03 21:39 ---
First question to decide is what direction they want to go with it, that's an
LTO question.  Once that is decided, if the direction to do is to change
darwin.c, I have given the 3 lines to do that, what remains undone with that
solution is testing, and the correct spelling of LTO_SYM, both of which are LTO
issues.  I could create a patch with the addition of the three lines, but that
isn't any harder than just cutting and pasting the three lines given, I don't
think.  Let me know the spelling and I can.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-03 Thread howarth at nitro dot med dot uc dot edu


--- Comment #38 from howarth at nitro dot med dot uc dot edu  2010-05-03 
22:01 ---
Mike,
   I was more interested about the second option since you seem to indicate
that the first option would pessimize the the LTO code generation on i386
darwin. Or did I misunderstand that comment?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-03 Thread steven at gcc dot gnu dot org


--- Comment #39 from steven at gcc dot gnu dot org  2010-05-03 22:15 ---
I still don't understand the 32 bits problem.

Without LTO, there is this code in the for 2008_0.i:
L_mumble$non_lazy_ptr:
.indirect_symbol _mumble

In the WPA code mumble is gone in the code for 2008_1.i (and so is the
whole declaration for mumble) but the .indirect_symbol is also not in the WPA
asm for 2008_0.i.

Something in the darwin backend appears to believe that _mumble has already
been written to the assembler files. 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-03 Thread mrs at gcc dot gnu dot org


--- Comment #40 from mrs at gcc dot gnu dot org  2010-05-03 22:47 ---
Jack, if I follow what you want, that's an LTO fix, I don't know the LTO code. 
I don't know that that fix is even possible.  I think one must do the LTO_SYM
fix, if I had to guess.  I don't have the time to embark upon learning all the
LTO bits to that work.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-03 Thread howarth at nitro dot med dot uc dot edu


--- Comment #41 from howarth at nitro dot med dot uc dot edu  2010-05-03 
23:41 ---
I wonder if...

/* Given the decl DECL, return the prevailing decl with the same name. */

tree
lto_symtab_prevailing_decl (tree decl)
{
  lto_symtab_entry_t ret;

  /* Builtins and local symbols are their own prevailing decl.  */
  if (!TREE_PUBLIC (decl) || is_builtin_fn (decl))
return decl;

  /* DECL_ABSTRACTs are their own prevailng decl.  */
  if (TREE_CODE (decl) == FUNCTION_DECL  DECL_ABSTRACT (decl))
return decl;

  /* Ensure DECL_ASSEMBLER_NAME will not set assembler name.  */
  gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl));

  /* Walk through the list of candidates and return the one we merged to.  */
  ret = lto_symtab_get (DECL_ASSEMBLER_NAME (decl));
  if (!ret)
return NULL_TREE;

  return ret-decl;
}

in lto-symtab.c is at all relevant to the problem. Otherwise, could we somehow
access the status of lto_mode_d from collect2.c from within darwin.c?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-02 Thread howarth at nitro dot med dot uc dot edu


--- Comment #34 from howarth at nitro dot med dot uc dot edu  2010-05-02 
13:11 ---
Mike,
 Can you flesh out the implementation of the second option of putting all
of the symbols in the wpa? Would this only require changes to darwin specific
files or a change to the LTO mechanism itself? 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-02 Thread howarth at nitro dot med dot uc dot edu


--- Comment #35 from howarth at nitro dot med dot uc dot edu  2010-05-02 
13:59 ---
Proposed patch for LTO support on Mach-O posted at
http://gcc.gnu.org/ml/gcc-patches/2010-05/msg00041.html.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-02 Thread howarth at nitro dot med dot uc dot edu


--- Comment #36 from howarth at nitro dot med dot uc dot edu  2010-05-02 
19:15 ---
Testresults on x86_64-apple-darwin10 at r158962 for proposed patch...

http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg00185.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread steven at gcc dot gnu dot org


--- Comment #19 from steven at gcc dot gnu dot org  2010-05-01 14:40 ---
Created an attachment (id=20526)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20526action=view)
proof-of-concept patch, with Mach-O writer implemented now

Remaining failures due to missing support for what's tested:
gcc.dg/lto/20081222_1.c:14:21: error: only weak aliases are supported in this
configuration
gcc.dg/lto/20090914: Unknown pseudo-op: .type 
gcc.dg/lto/20100423: Undefined symbols: _stderr
g++.dg/lto/20100302: Undefined symbols: f(float __vector(4)*)

Remaining real failures:
gcc.dg/lto/20090126: lto1: internal compiler error: Segmentation fault


-- 

steven at gcc dot gnu dot org changed:

   What|Removed |Added

  Attachment #20500|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread steven at gcc dot gnu dot org


--- Comment #20 from steven at gcc dot gnu dot org  2010-05-01 14:43 ---
On x86_64-unknown-linux-gnu, I see that gcc.dg/lto/20090126 also fails (see
http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg00031.html).  So the test
suite results on x86_64-darwin are the same as on x86_64-linux modulo
unsupported features / ELFisms / GLIBCisms.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread rguenth at gcc dot gnu dot org


--- Comment #21 from rguenth at gcc dot gnu dot org  2010-05-01 14:53 
---
+  /* ??? Some targets need to handle LTO assembler output specially.
+ Is this the right place to hanlde that?  */
+  if (flag_generate_lto)

yes.

+  if (flag_generate_lto)
+targetm.asm_out.lto_end ();

should be right after ipa_write_summaries

+  /* FIXME Need to document this.  */
   off_t offset;

this is the offset for the ELF object inside an ar archive file (or zero)

-
+if(1) return true;

eh?

Not looking at the darwin / mach-o specific parts this looks good to me.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread dominiq at lps dot ens dot fr


--- Comment #22 from dominiq at lps dot ens dot fr  2010-05-01 15:26 ---
Sorry to bother you, but with the patch in comment #19 bootstrap fails at stage
2 with the infamous all warnings being treated as errors:

...
/opt/gcc/build_w/./prev-gcc/xgcc -B/opt/gcc/build_w/./prev-gcc/
-B/opt/gcc/gcc4.6w/x86_64-apple-darwin10/bin/
-B/opt/gcc/gcc4.6w/x86_64-apple-darwin10/bin/
-B/opt/gcc/gcc4.6w/x86_64-apple-darwin10/lib/ -isystem
/opt/gcc/gcc4.6w/x86_64-apple-darwin10/include -isystem
/opt/gcc/gcc4.6w/x86_64-apple-darwin10/sys-include-c  -g -O2 -gtoggle
-DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition
-Wc++-compat -fno-common  -DHAVE_CONFIG_H -I. -Ilto -I../../work/gcc
-I../../work/gcc/lto -I../../work/gcc/../include
-I../../work/gcc/../libcpp/include -I/opt/sw64/include -I/opt/sw64/include 
-I../../work/gcc/../libdecnumber -I../../work/gcc/../libdecnumber/dpd
-I../libdecnumber -I/opt/sw64/include  -I/opt/sw64/include -DCLOOG_PPL_BACKEND 
 -I/opt/sw64/include ../../work/gcc/lto/lto-macho.c -o lto/lto-macho.o
In file included from ../../work/gcc/lto/lto-macho.c:31:0:
../../work/gcc/lto/lto-macho.h:221:33: error: using 'lto_mach_o_data' as both a
typedef and a tag is invalid in C++ [-Werror=c++-compat]
../../work/gcc/lto/lto-macho.h:205:8: note: originally defined here
../../work/gcc/lto/lto-macho.h:255:36: error: using 'lto_mach_o_section' as
both a typedef and a tag is invalid in C++ [-Werror=c++-compat]
../../work/gcc/lto/lto-macho.h:206:8: note: originally defined here
cc1: all warnings being treated as errors


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread dominiq at lps dot ens dot fr


--- Comment #23 from dominiq at lps dot ens dot fr  2010-05-01 21:40 ---
After some surgery in gcc/lto/lto-macho.h and gcc/lto/lto-macho.c, I have
managed to bootstrap. Now the full polyhedron test pass without failure. The
timings with my default options, with -fwhole-file, and with -flto follows
(Core2Duo 2.53Ghz, 3Mb cache, 4Gb RAM):


Date  Time : 22 Apr 2010 10:44:08
Test Name   : pbharness
Compile Command : gfc %n.f90 -O3 -ffast-math -funroll-loops -ftree-loop-linear 
 -fomit-frame-pointer -finline-limit=600 
 --param min-vect-loop-bound=2 -o %n
Benchmarks  : ac aermod air capacita channel doduc fatigue gas_dyn induct 
  linpk mdbx nf protein rnflow test_fpu tfft
Maximum Times   :  300.0
Target Error %  :  0.200
Minimum Repeats : 2
Maximum Repeats : 5

   Benchmark   Compile  Executable   Ave Run  Number   Estim
Name(secs) (bytes)(secs) Repeats   Err %
   -   ---  --   --- ---  --
  ac  2.23   46792 10.14   2  0.
  aermod 74.42 1419504 22.70   2  0.1542
 air  5.47   77848  6.96   5  0.4008
capacita  7.68  126824 40.90   2  0.0685
 channel  1.91   34664  2.92   2  0.0685
   doduc 10.08  196872 29.89   4  0.1952
 fatigue  4.40   85688  8.39   2  0.1370
 gas_dyn  7.11  725640  4.90   5  0.6075
  induct  8.10  186864 14.23   2  0.0914
   linpk  1.50   38544 21.66   2  0.0277
mdbx  2.75   73864 12.55   2  0.0597
  nf 23.55  153376 29.98   2  0.1568
 protein 10.43  127520 38.66   2  0.0375
  rnflow 15.93  205136 26.50   2  0.0019
test_fpu  8.91  158968 11.50   2  0.0391
tfft  1.15   26584  3.28   2  0.1829

Geometric Mean Execution Time =  13.38 seconds


Date  Time : 15 Apr 2010 12:07:17
Test Name   : pbharness
Compile Command : gfc %n.f90 -O3 -ffast-math -funroll-loops -ftree-loop-linear 
 -fomit-frame-pointer -finline-limit=600 
 --param min-vect-loop-bound=2 -fwhole-file -o %n
Benchmarks  : ac aermod air capacita channel doduc fatigue gas_dyn induct 
  linpk mdbx nf protein rnflow test_fpu tfft
Maximum Times   :  300.0
Target Error %  :  0.200
Minimum Repeats : 2
Maximum Repeats : 5

   Benchmark   Compile  Executable   Ave Run  Number   Estim
Name(secs) (bytes)(secs) Repeats   Err %
   -   ---  --   --- ---  --
  ac  2.98   42696  8.96   2  0.0056
  aermod 98.92 1808760 21.42   2  0.0700
 air 13.09  114728  7.14   5  0.2725
capacita  8.00  135016 40.78   2  0.0037
 channel  1.75   34664  2.92   3  0.1769
   doduc 12.56  250192 28.59   2  0.0052
 fatigue  5.15  102112  8.44   2  0.0118
 gas_dyn  7.39  729736  4.90   5  0.3932
  induct 11.50  28 14.16   2  0.0035
   linpk  1.81   50848 21.68   2  0.0208
mdbx  7.05  139448 12.55   2  0.0159
  nf 20.10  157504 28.99   5  0.1680
 protein 13.03  147992 38.94   2  0.0116
  rnflow 17.64  229760 26.05   2  0.0134
test_fpu  9.77  183608 11.42   4  0.1691
tfft  1.28   34808  3.29   2  0.0912

Geometric Mean Execution Time =  13.17 seconds


Date  Time :  1 May 2010 23:04:52
Test Name   : pbharness
Compile Command : gfc %n.f90 -O3 -ffast-math -funroll-loops -ftree-loop-linear 
 -fomit-frame-pointer -finline-limit=600 
 --param min-vect-loop-bound=2 -flto -o %n
Benchmarks  : ac aermod air capacita channel doduc fatigue gas_dyn induct 
  linpk mdbx nf protein rnflow test_fpu tfft
Maximum Times   :  300.0
Target Error %  :  0.200
Minimum Repeats : 2
Maximum Repeats : 5

   Benchmark   Compile  Executable   Ave Run  Number   Estim
Name(secs) (bytes)(secs) Repeats   Err %
   -   ---  --   --- ---  --
  ac  6.36   46800  8.44   2  0.0118
  aermod194.06 1901544 19.00   2  0.0632
 air 23.06  106816  7.27   5  0.1278
capacita 

[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread steven at gcc dot gnu dot org


--- Comment #24 from steven at gcc dot gnu dot org  2010-05-01 21:51 ---
Created an attachment (id=20527)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20527action=view)
final patch

I plan to submit this, but with 32 bits disabled because I get failures I don't
understand.


-- 

steven at gcc dot gnu dot org changed:

   What|Removed |Added

  Attachment #20526|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread howarth at nitro dot med dot uc dot edu


--- Comment #25 from howarth at nitro dot med dot uc dot edu  2010-05-01 
22:18 ---
Steven,
Do you mean the errors which have symbol xxx can't be undefined in a
subtraction expression? A google shows this to look like that discussed
here...

http://gcc.gnu.org/ml/gcc-bugs/2003-11/msg01552.html

which is apparently PR10901. On gpc seems to have been worked around with a 
--longjmp-all-nonlocal-labels option?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread stevenb dot gcc at gmail dot com


--- Comment #26 from stevenb dot gcc at gmail dot com  2010-05-01 22:30 
---
Subject: Re:  Mach-O LTO support needed for darwin

    Do you mean the errors which have symbol xxx can't be undefined in a
 subtraction expression?

Yes, exactly those.

 A google shows this to look like that discussed
 here...

 http://gcc.gnu.org/ml/gcc-bugs/2003-11/msg01552.html

 which is apparently PR10901. On gpc seems to have been worked around with a
 --longjmp-all-nonlocal-labels option?

I don't think that's the same problem. With LTO it happens for regular
variables. But perhaps the problems are related.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread mrs at gcc dot gnu dot org


--- Comment #27 from mrs at gcc dot gnu dot org  2010-05-01 23:22 ---
Ok for all the darwin bits with any necessary mods to turn off or fix the
32-bit port.  If you attach the the 32-bit .s file, I can puzzle it out for
you.  In short, only - of two defined symbols in the same section work.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread howarth at nitro dot med dot uc dot edu


--- Comment #28 from howarth at nitro dot med dot uc dot edu  2010-05-01 
23:59 ---
Created an attachment (id=20529)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20529action=view)
example 32-bit failing testcase


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread howarth at nitro dot med dot uc dot edu


--- Comment #29 from howarth at nitro dot med dot uc dot edu  2010-05-02 
00:01 ---
Mike,
I've attached one of the failing testcases with all of the files generated
by the commands...

/Users/stevenb/lto_objdir32/gcc/xgcc -B/Users/stevenb/lto_objdir32/gcc/ 
--save-temps -O0 -fwhopr  -c  -o c_lto_2008_0.o
/Users/stevenb/gcc_trunk/gcc/testsuite/gcc.dg/lto/2008_0.c
/Users/stevenb/lto_objdir32/gcc/xgcc -B/Users/stevenb/lto_objdir32/gcc/ 
--save-temps -O0 -fwhopr  -c  -o c_lto_2008_1.o
/Users/stevenb/gcc_trunk/gcc/testsuite/gcc.dg/lto/2008_1.c
/Users/stevenb/lto_objdir32/gcc/xgcc -B/Users/stevenb/lto_objdir32/gcc/
c_lto_2008_0.o c_lto_2008_1.o  -v --save-temps -O0 -fwhopr   -o
gcc-dg-lto-2008-01

Unfortunately this testcase produces an empty gcc-dg-lto-2008-01.s file.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread howarth at nitro dot med dot uc dot edu


--- Comment #30 from howarth at nitro dot med dot uc dot edu  2010-05-02 
00:07 ---
Created an attachment (id=20530)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20530action=view)
non-failing testcase for 64-bit


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread howarth at nitro dot med dot uc dot edu


--- Comment #31 from howarth at nitro dot med dot uc dot edu  2010-05-02 
00:09 ---
Mike,
I've also attached the same non-failing testcase from the x86_64 build
generated with the commands...

/Users/stevenb/lto_objdir/gcc/xgcc -B/Users/stevenb/lto_objdir/gcc/ 
--save-temps -O0 -fwhopr  -c  -o c_lto_2008_0.o
/Users/stevenb/gcc_trunk/gcc/testsuite/gcc.dg/lto/2008_0.c
/Users/stevenb/lto_objdir/gcc/xgcc -B/Users/stevenb/lto_objdir/gcc/ 
--save-temps -O0 -fwhopr  -c  -o c_lto_2008_1.o
/Users/stevenb/gcc_trunk/gcc/testsuite/gcc.dg/lto/2008_1.c
/Users/stevenb/lto_objdir/gcc/xgcc -B/Users/stevenb/lto_objdir/gcc/
c_lto_2008_0.o c_lto_2008_1.o  -v --save-temps -O0 -fwhopr   -o
gcc-dg-lto-2008-01


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread howarth at nitro dot med dot uc dot edu


--- Comment #32 from howarth at nitro dot med dot uc dot edu  2010-05-02 
00:47 ---
The failing command out of the log from the 32-bit testcase is...

/Users/stevenb/lto_objdir32/gcc/lto1 -fPIC -quiet -dumpbase
gcc-dg-lto-2008-01.ltrans0 -dumpdir ./ -mmacosx-version-min=10.6.3
-mtune=generic -auxbase-strip c_lto_2008_1.wpa.ltrans.o -O0 -version
-fltrans c_lto_2008_1.wpa.o -o c_lto_2008_1.wpa.s

and produces the file  c_lto_2008_1.wpa.s containing...

.text
.globl _bar
_bar:
pushl   %ebp
movl%esp, %ebp
subl$8, %esp
call___i686.get_pc_thunk.cx
L001$pb:
leal_mumble-L001$pb(%ecx), %eax
movl(%eax), %eax
leave
ret
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
.weak_definition___i686.get_pc_thunk.cx
.private_extern ___i686.get_pc_thunk.cx
___i686.get_pc_thunk.cx:
movl(%esp), %ecx
ret
.subsections_via_symbols


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-05-01 Thread mrs at gcc dot gnu dot org


--- Comment #33 from mrs at gcc dot gnu dot org  2010-05-02 01:23 ---
So, mumble isn't defined in the wpa file.  The .wpa. file has to be assembled
at the same time as 2008_1.s, or, different code would need to be
generated.  darwin.c manages the code gen by asking the question, is this
symbol _defined_ in the translation unit or _must_ it be defined.  The answer
from that question must be valid.  In this case, someone lied to us.  So, if
there is a new answer, like, is this symbol defined in an LTO segment, we could
modify the underlying question do be:

is_defined(sym) {
  if (LTO_SYM(sym) return false;
  [ ... ]
|

which should be seamless, but, one then pays the price for this in less good
codegen.  If one bundles all the code into the wpa file, one can preserve
_good_ codegen, which is the other way to fix this.  machopic_symbol_defined_p
is the is_defined predicate above, if you want to go that path.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-29 Thread steven at gcc dot gnu dot org


--- Comment #16 from steven at gcc dot gnu dot org  2010-04-29 10:48 ---
Re. comment #14 this is now Apple radar 7920267. Let's see if someone on their
end can cq. is willing to help us out here.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-29 Thread steven at gcc dot gnu dot org


--- Comment #17 from steven at gcc dot gnu dot org  2010-04-29 11:39 ---
I've played a bit with modified .s files by hand, and as/ld work if the LTO
sections follow the other sections.

The normal order of output with -flto looks like this in the .s file:

LTO sections (the __GNU_LTO stuff)
.text / .data / etc. (all non-LTO sections)
LTO __section_names section

With this order I get the linker error.

I do *not* get the linker error if I re-order the .s file by hand to look like
this:

.text / .data / etc. (all non-LTO sections)
LTO sections (the __GNU_LTO stuff)
LTO __section_names section

With this order, the .s file looks identical with and without -flto, except for
the extra LTO sections after the non-LTO stuff of course. And with this order,
the linker doesn't give an error.

I don't understand this at all. It is almost as if the compiler somehow writes
an address relative to start-of-file, but the compiler doesn't know about
addresses (it can write labels and such, but not count bytes from
start-of-file).

Anyway, I did some research with Google and we are not the first to encounter
this problem. Apparently it doesn't happen in 32-bits mode, so I'll implement
that now and try that.

The important conclusion for me, is that the LTO patch is OK and the bug is
somewhere else :-)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-29 Thread howarth at nitro dot med dot uc dot edu


--- Comment #18 from howarth at nitro dot med dot uc dot edu  2010-04-29 
13:20 ---
Does the executable created from the manually reordered aermod.s run correctly?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-28 Thread dominiq at lps dot ens dot fr


--- Comment #13 from dominiq at lps dot ens dot fr  2010-04-28 12:20 ---
 proof-of-concept patch

Great!-) Thanks a lot. 

Besides the 17 C failures, for all languages but ADA, I also see

FAIL: g++.dg/lto/20100302 cp_lto_20100302_0.o-cp_lto_20100302_1.o link

and

FAIL: gcc.c-torture/execute/cmpdi-1.c compilation,  -O3 -g
FAIL: gfortran.dg/array_constructor_11.f90  -O3 -g  (internal compiler error)

but they are probably unrelated.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-28 Thread dominiq at lps dot ens dot fr


--- Comment #14 from dominiq at lps dot ens dot fr  2010-04-28 13:04 ---
Note also that the polyhedron test aermod.f90 fails with -flto or -whopr at any
level of optimization with:

ld: in /var/tmp//ccDGk6QZ.o, in section __TEXT,__text reloc 17: local
relocation for address 0x000E58F4 in section __text does not target section
__0B61


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-28 Thread steven at gcc dot gnu dot org


--- Comment #15 from steven at gcc dot gnu dot org  2010-04-28 19:50 ---
Re. comment #14, this is obviously related to LTO but we (gcc) don't do
anything with relocations. I'll try to reproduce this problem, but I suspect it
is an assembler or linker bug.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-27 Thread steven at gcc dot gnu dot org


--- Comment #12 from steven at gcc dot gnu dot org  2010-04-27 20:25 ---
Created an attachment (id=20500)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20500action=view)
proof-of-concept patch

This doesn't even include a Mach-O writer yet (except for the to be rewritten
COFF writer ;-) but this already makes LTO work for most of the test suite. For
lto.exp, C only:

Test Run By stevenb on Tue Apr 27 16:20:21 2010
Native configuration is x86_64-apple-darwin10.3.0

=== gcc tests ===

Schedule of variations:
unix

Running target unix
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /Users/stevenb/gcc_trunk/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /Users/stevenb/gcc_trunk/gcc/testsuite/gcc.dg/lto/lto.exp ...
FAIL: gcc.dg/lto/20081201-2 c_lto_20081201-2_0.o-c_lto_20081201-2_1.o execute
-O3 -fwhopr
FAIL: gcc.dg/lto/20081222 c_lto_20081222_1.o assemble, -O0 -fwhopr
FAIL: gcc.dg/lto/20081222 c_lto_20081222_1.o assemble, -O2 -fwhopr
FAIL: gcc.dg/lto/20081222 c_lto_20081222_1.o assemble, -O0 -flto
FAIL: gcc.dg/lto/20081222 c_lto_20081222_1.o assemble, -O2 -flto
FAIL: gcc.dg/lto/20090914-2 c_lto_20090914-2_0.o assemble, -O0 -fwhopr
FAIL: gcc.dg/lto/20090914-2 c_lto_20090914-2_0.o assemble, -O2 -fwhopr
FAIL: gcc.dg/lto/20090914-2 c_lto_20090914-2_0.o assemble, -O0 -flto
FAIL: gcc.dg/lto/20090914-2 c_lto_20090914-2_0.o assemble, -O2 -flto
FAIL: gcc.dg/lto/20091216-1 c_lto_20091216-1_0.o-c_lto_20091216-1_0.o link
FAIL: gcc.dg/lto/20091216-1 c_lto_20091216-1_0.o-c_lto_20091216-1_0.o link
FAIL: gcc.dg/lto/20091216-1 c_lto_20091216-1_0.o-c_lto_20091216-1_0.o link
FAIL: gcc.dg/lto/20091216-1 c_lto_20091216-1_0.o-c_lto_20091216-1_0.o link
FAIL: gcc.dg/lto/20100423-2 c_lto_20100423-2_0.o-c_lto_20100423-2_1.o link
FAIL: gcc.dg/lto/20100423-2 c_lto_20100423-2_0.o-c_lto_20100423-2_1.o link
FAIL: gcc.dg/lto/20100423-2 c_lto_20100423-2_0.o-c_lto_20100423-2_1.o link
FAIL: gcc.dg/lto/20100423-2 c_lto_20100423-2_0.o-c_lto_20100423-2_1.o link

=== gcc Summary ===

# of expected passes479
# of unexpected failures17
# of unresolved testcases   24
# of unsupported tests  2
/Users/stevenb/lto_objdir/gcc/xgcc  version 4.6.0 20100427 (experimental)
[trunk revision 158800] (GCC) 


There's still work to be done:
1) Try with other languages
2) Make it with with checking enabled (shouldn't make a difference)
3) Produce distinct error message per failure mode
4) Implement the writer
n) ... fix whatever needs fixing ...

I plan to go through the list as time permits. Help welcome (as are patches).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-26 Thread mrs at gcc dot gnu dot org


--- Comment #8 from mrs at gcc dot gnu dot org  2010-04-26 14:49 ---
One open question for me would be, are 16 bytes of an arbitrary named
section/segment enough?  It you carve out a slice, say lto_%d, that leaves just
12 bytes for the `name', if this big enough?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-26 Thread stevenb dot gcc at gmail dot com


--- Comment #9 from stevenb dot gcc at gmail dot com  2010-04-26 16:06 
---
Subject: Re:  Mach-O LTO support needed for darwin

Mach-O section names are too short, but I have solved this with a
separate section with section names in a strings table. This is
similar to the solution from lto-coff.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-26 Thread davek at gcc dot gnu dot org


--- Comment #10 from davek at gcc dot gnu dot org  2010-04-26 18:39 ---
(In reply to comment #1)

   I don't speak Mach-O, but yes, the approach should work.  You'd start by
 saying lto_binary_reader=lto-mach-o in config.gcc and adding a new
 lto/lto-mach-o.c with the same handful of toplevel functions: open and close
 file, build section hash, and create section and append binary data to 
 section.

Oh, and the one last thing I forgot to mention: update is_elf_or_coff() in
collect2.c so it recognizes Mach-O object files as well as ELF/COFF. 

(That may be evident by now anyway, but I thought I'd leave it here for the
record anyway.)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-26 Thread davek at gcc dot gnu dot org


--- Comment #11 from davek at gcc dot gnu dot org  2010-04-27 02:35 ---
I noticed the dependency was the wrong way round when I saw that this open bug
was blocking a freshly-closed one :)


-- 

davek at gcc dot gnu dot org changed:

   What|Removed |Added

  BugsThisDependsOn||42776
OtherBugsDependingO|42776   |
  nThis||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-19 Thread steven at gcc dot gnu dot org


-- 

steven at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |steven at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2010-04-12 15:55:01 |2010-04-19 07:40:34
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-15 Thread howarth at nitro dot med dot uc dot edu


--- Comment #6 from howarth at nitro dot med dot uc dot edu  2010-04-15 
13:48 ---
Can we just use the LTO COFF patch...

http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00612.html

as a template? Hopefully we can just remove the unnecessary sections of the
patch and rename things as appropriate (for a first pass at implementing the
Mach-O LTO support).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-15 Thread stevenb dot gcc at gmail dot com


--- Comment #7 from stevenb dot gcc at gmail dot com  2010-04-15 14:03 
---
Subject: Re:  Mach-O LTO support needed for darwin

 Can we just use the LTO COFF patch...as a template?

That is certainly my plan, yes.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729



[Bug target/43729] Mach-O LTO support needed for darwin

2010-04-14 Thread steven at gcc dot gnu dot org


--- Comment #5 from steven at gcc dot gnu dot org  2010-04-14 22:10 ---
Collecting bits and pieces from all over, I'm trying to make a plan...

Consensus on IRC is that LTO data does not need its own Mach-O segment, and
that can it just fit as a section in the _TEXT (since LTO data is read-only) or
_DATA segment.

Re. changes in the darwin assembler/linker, it looks like they will just work.
From http://gcc.gnu.org/ml/gcc/2010-04/msg00250.html:
-
Binutils for COFF targets needed a patch to allow sections to be
byte-aligned and byte-packed, as it wasn't originally possible to use any
alignment directive to reduce the section alignment below the default, and the
zip-compressed data sections need to be exactly sized to the data they contain
rather than padded up to the default section alignment of 4.

 If MachO can do that already, it won't need any changes.  Or it could be
fixed in GCC by modifying the format of the compressed sections to be
self-describing w.r.t valid data length in some way - this would probably be
the better thing to do in the long run.
-

So. Can MachO binutils already do that? Apparently yes:

$ as  .section __TEXT,__foo

gives a section alignment of 2^0=1 i.e. byte-aligned.

Alternatively, it is possible to disable zlib compression, although we should
try to avoid that.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729