[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-26 Thread hjl dot tools at gmail dot com


--- Comment #17 from hjl dot tools at gmail dot com  2009-10-26 16:59 
---
Revision 152433 is OK and revision 152642 is bad.


-- 


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-26 Thread hjl dot tools at gmail dot com


--- Comment #18 from hjl dot tools at gmail dot com  2009-10-26 19:19 
---
This is another IPA-SRA bug.


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

 CC||jamborm at gcc dot gnu dot
   ||org
   Last reconfirmed|-00-00 00:00:00 |2009-10-26 19:19:42
   date||


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-20 Thread rainer at emrich-ebersheim dot de


--- Comment #12 from rainer at emrich-ebersheim dot de  2009-10-20 18:04 
---
First of all, it's nearly impossible to create a short self contained test
case, at least for me. The function get_got in bfd/elf64-ia64.c shows the
issue.
Resolving the dependencies of this function is like opening a can of worms.

What I have:
I verified that enclosing only the get_got function in 
#pragma GCC optimize (ipa-sra, no-inline)
.
.
#pragma GCC reset_options
yields the fault.

In contrast enclosing the get_got function in
#pragma GCC optimize (no-ipa-sra, no-inline)
.
.
#pragma GCC reset_options
gives a working ia64-unknown-linux-gnu-ld.

I'm attaching both versions as preprocessed source.

compiling these with gcc -g -O2 -S produces the correspondent assembler output,
also attached.


-- 


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-20 Thread rainer at emrich-ebersheim dot de


--- Comment #13 from rainer at emrich-ebersheim dot de  2009-10-20 18:13 
---
Created an attachment (id=18841)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18841action=view)
preproccessed source

no-ipa-sra, no-inline


-- 


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-20 Thread rainer at emrich-ebersheim dot de


--- Comment #14 from rainer at emrich-ebersheim dot de  2009-10-20 18:14 
---
Created an attachment (id=18842)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18842action=view)
preproccessed source

ipa-sra, no-inline


-- 


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-20 Thread rainer at emrich-ebersheim dot de


--- Comment #15 from rainer at emrich-ebersheim dot de  2009-10-20 18:15 
---
Created an attachment (id=18843)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18843action=view)
assembler output


-- 


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-20 Thread rainer at emrich-ebersheim dot de


--- Comment #16 from rainer at emrich-ebersheim dot de  2009-10-20 18:16 
---
Created an attachment (id=18844)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18844action=view)
assembler output


-- 


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-19 Thread rainer at emrich-ebersheim dot de


--- Comment #5 from rainer at emrich-ebersheim dot de  2009-10-19 14:46 
---
works when build with -g -O0 and -g -O1.
fails when build with -g -O2 and -g -O3.


-- 


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-19 Thread jakub at gcc dot gnu dot org


--- Comment #6 from jakub at gcc dot gnu dot org  2009-10-19 15:21 ---
Try also -g -O2 -fno-strict-aliasing, if that one works, look for aliasing
warnings.


-- 


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-19 Thread rainer at emrich-ebersheim dot de


--- Comment #7 from rainer at emrich-ebersheim dot de  2009-10-19 16:08 
---
Subject: Re:  gcc 4.5.0 miscompiles binutils

jakub at gcc dot gnu dot org wrote:
 --- Comment #6 from jakub at gcc dot gnu dot org  2009-10-19 15:21 ---
 Try also -g -O2 -fno-strict-aliasing, if that one works, look for aliasing
 warnings.
 
 

works when build with -g -O2 -fno-ipa-sra and -g -O3 -fno-ipa-sra.

So, that's the easy part. Try to get further. Any help appreciated.


-- 


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-19 Thread rainer at emrich-ebersheim dot de


--- Comment #8 from rainer at emrich-ebersheim dot de  2009-10-19 16:19 
---
fails when build with -g -O1 -fipa-sra.

So, the ipa-sra pass causes the issue, no?


-- 


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-19 Thread rainer at emrich-ebersheim dot de


--- Comment #9 from rainer at emrich-ebersheim dot de  2009-10-19 16:30 
---
build with -g -O1 -fipa-sra -fno-inline I get the following backtrace:

Core was generated by `ia64-unknown-linux-gnu-ld --verbose
--sysroot=/opt/devel/tec/setup/sys-root/Lin'.
Program terminated with signal 11, Segmentation fault.
#0  0x0043c3e3 in get_got (abfd=0x711300, info=value optimized out)
at elf64-ia64.c:2073
2073  return x-addend  y-addend ? -1 : x-addend  y-addend ? 1 : 0;
(gdb) where
#0  0x0043c3e3 in get_got (abfd=0x711300, info=value optimized out)
at elf64-ia64.c:2073
#1  0x0043c9bc in elf64_ia64_check_relocs (abfd=value optimized out,
info=0x6ead00, sec=value optimized out, relocs=value optimized out) at
elf64-ia64.c:2073
#2  0x00459a52 in elf_link_add_object_symbols (abfd=value optimized
out, info=value optimized out) at
/opt/devel/gnu/src/gcc/binutils-2.20/bfd/elflink.c:477
#3  0x00459e85 in bfd_elf_link_add_symbols (abfd=value optimized out,
info=value optimized out) at
/opt/devel/gnu/src/gcc/binutils-2.20/bfd/elflink.c:477
#4  0x0040f947 in load_symbols (entry=0x6eb1e0, place=value optimized
out) at /opt/devel/gnu/src/gcc/binutils-2.20/ld/ldlang.c:353
#5  0x0040fea4 in open_input_bfds (s=0x6eb1e0, force=0) at
/opt/devel/gnu/src/gcc/binutils-2.20/ld/ldlang.c:353
#6  0x0041217e in lang_process () at
/opt/devel/gnu/src/gcc/binutils-2.20/ld/ldlang.c:353
#7  0x00414cc0 in main (argc=27, argv=0x7fffa21c0d78) at
/opt/devel/gnu/src/gcc/binutils-2.20/ld/ldmain.c:1383
(gdb) 


-- 


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-19 Thread rainer at emrich-ebersheim dot de


--- Comment #10 from rainer at emrich-ebersheim dot de  2009-10-19 17:06 
---
The line numbers in the traceback in comment #9 are completly bogus. I had to
upgrade my gdb to version 0.7. Now it looks much better:

Core was generated by `ia64-unknown-linux-gnu-ld --verbose
--sysroot=/opt/devel/tec/setup/sys-root/Lin'.
Program terminated with signal 11, Segmentation fault.
#0  get_got (abfd=0x711300, info=value optimized out) at elf64-ia64.c:2418
2418  if (!bfd_set_section_alignment (abfd, got, 3))
(gdb) where
#0  get_got (abfd=0x711300, info=value optimized out) at elf64-ia64.c:2418
#1  0x0043c9bc in elf64_ia64_check_relocs (abfd=value optimized out,
info=0x6ead00, sec=value optimized out, relocs=value optimized out) at
elf64-ia64.c:2973
#2  0x00459a52 in elf_link_add_object_symbols (abfd=value optimized
out, info=value optimized out) at
/opt/devel/gnu/src/gcc/binutils-2.20/bfd/elflink.c:4774
#3  0x00459e85 in bfd_elf_link_add_symbols (abfd=value optimized out,
info=value optimized out) at
/opt/devel/gnu/src/gcc/binutils-2.20/bfd/elflink.c:5097
#4  0x0040f947 in load_symbols (entry=0x6eb1e0, place=value optimized
out) at /opt/devel/gnu/src/gcc/binutils-2.20/ld/ldlang.c:2707
#5  0x0040fea4 in open_input_bfds (s=0x6eb1e0, force=0) at
/opt/devel/gnu/src/gcc/binutils-2.20/ld/ldlang.c:3138
#6  0x0041217e in lang_process () at
/opt/devel/gnu/src/gcc/binutils-2.20/ld/ldlang.c:6287
#7  0x00414cc0 in main (argc=27, argv=0x7fffa21c0d78) at
/opt/devel/gnu/src/gcc/binutils-2.20/ld/ldmain.c:455
(gdb) 


-- 


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



[Bug middle-end/41750] gcc 4.5.0 miscompiles binutils

2009-10-19 Thread rainer at emrich-ebersheim dot de


--- Comment #11 from rainer at emrich-ebersheim dot de  2009-10-19 17:24 
---
verified that compiling only bfd/elf64-ia64.c with -fno-ipa-sra is sufficient
to get a working ia64-unknown-linux-gnu-ld.


-- 


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