Bug 23579

Summary: [4.1 regression] rtl-optimization/23478 breaks Ada for ia64
Product: gcc Reporter: Andreas Schwab <schwab>
Component: targetAssignee: Jim Wilson <wilson>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, jakub, phython
Priority: P2 Keywords: ice-on-valid-code
Version: 4.1.0   
Target Milestone: 4.1.0   
Host: Target: ia64-*-linux
Build: Known to work:
Known to fail: Last reconfirmed:
Bug Depends on: 24232    
Bug Blocks: 23478    

Description Andreas Schwab 2005-08-26 16:57:49 UTC
The patch from rtl-optimization/23478 breaks Ada:  
  
$ gdb --args ../../gnat1 -quiet -dumpbase a-stzmap.adb -O2 -W -Wall -fPIC -g  
-gnatpg -gnatO a-stzmap.o a-stzmap.adb -o /tmp/ccH9s7Af.s  
GNU gdb 6.3  
Copyright 2004 Free Software Foundation, Inc.  
GDB is free software, covered by the GNU General Public License, and you are  
welcome to change it and/or distribute copies of it under certain conditions.  
Type "show copying" to see the conditions.  
There is absolutely no warranty for GDB.  Type "show warranty" for details.  
This GDB was configured as "ia64-suse-linux"...Using host libthread_db library  
"/lib/tls/libthread_db.so.1".  
  
(gdb) r  
Starting program: /tmp/cvs/gcc-test-20050823/Build/gcc/gnat1 -quiet -dumpbase  
a-stzmap.adb -O2 -W -Wall -fPIC -g -gnatpg -gnatO a-stzmap.o a-stzmap.adb  
-o /tmp/ccH9s7Af.s  
  
Program received signal SIGSEGV, Segmentation fault.  
add_missing_bbs (before=0x200000000043ad40, first=0x20000000003c0e38,  
last=0x0)  
    at sched-ebb.c:220  
220           BB_HEAD (last) = before;  
(gdb) bt  
#0  add_missing_bbs (before=0x200000000043ad40, first=0x20000000003c0e38,   
    last=0x0) at sched-ebb.c:220  
#1  0x4000000000dbbd00 in schedule_ebbs (dump_file=0x20000000004dfc50)  
    at sched-ebb.c:329  
#2  0x4000000000b1f040 in ia64_reorg () at ia64.c:7701  
#3  0x4000000000db1b90 in rest_of_handle_machine_reorg () at reorg.c:3864  
#4  0x4000000000ac4ca0 in execute_one_pass (pass=0x60000000000156d0)  
    at passes.c:754  
#5  0x4000000000ac4f90 in execute_pass_list (pass=0x60000000000156d0)  
    at passes.c:837  
#6  0x4000000000ac4fe0 in execute_pass_list (pass=0x6000000000013338)  
    at passes.c:837  
#7  0x4000000000ac4fe0 in execute_pass_list (pass=0x6000000000013380)  
    at passes.c:837  
#8  0x40000000005dab80 in tree_rest_of_compilation (fndecl=0x20000000003eed00)  
    at tree-optimize.c:419  
#9  0x4000000000039690 in gnat_expand_body (gnu_decl=0x20000000003eed00)  
    at misc.c:636  
#10 0x4000000000b4b650 in cgraph_expand_function (node=0x20000000005af650)  
    at cgraphunit.c:1037  
#11 0x4000000000b4f8c0 in cgraph_optimize () at cgraphunit.c:1103  
#12 0x400000000003af60 in gnat_parse_file (set_yydebug=10846160) at  
misc.c:245#13 0x4000000000a57fd0 in toplev_main (argc=268536,  
argv=0x6000000000041910)  
    at toplev.c:1932  
#14 0x40000000005c71c0 in main (argc=268536, argv=0x6000000000041910)  
    at main.c:35
Comment 1 Andrew Pinski 2005-08-31 19:22:27 UTC
This looks more like a target bug as this is being called from ia64's reorg.
Comment 2 Jim Wilson 2005-10-15 17:03:42 UTC
I haven't been able to reproduce this.  I tried building a stage1 IA-64 ada compiler on both x86_64 and IA-64, using both mainline and the 20050826 snapshot, and none of these 4 compilers triggered the bug.

I am fairly confident that my patch for PR 24232 fixed this though.

I will try to do an Ada bootstrap on my IA-64 machine, and I will assume this is fixed if the bootstrap succeeds.  I'm not sure if I can do an Ada bootstrap though; it has been a while since I last tried.  I will soon find out.
Comment 3 Jim Wilson 2005-10-15 22:23:27 UTC
My build failed while building libada
../../xgcc -B../../  -c -g -O2 -fPIC -DUSE_GAS_SYMVER      -W -Wall -gnatpg  a-teioed.adb -o a-teioed.o
a-teioed.adb: In function 'Ada.Text_Io.Editing.Format_Number':
a-teioed.adb:843: error: call edges for non-call insn in bb 483
a-teioed.adb:843: error: call edges for non-call insn in bb 482
...
I haven't looked into this yet.
Comment 4 Andrew Pinski 2005-10-15 22:25:08 UTC
(In reply to comment #3)
> My build failed while building libada

That is PR 17356.
Comment 5 Jim Wilson 2005-10-16 22:45:24 UTC
I believe this is fixed.  I'm looking at 17356 now.