Ada broken on i686-linux (some progress)

Laurent GUERBY laurent@guerby.net
Sun Sep 12 17:52:00 GMT 2004


Hi Zdenek and Honza, I tried with HEAD plus Zdenek patch and still got
an ICE during stage2 with the following backtrace.

(gdb) r -I- -I. -Iada -I/home/guerby/work/gcc/version-head/gcc/ada -quiet -dumpbase g-os_lib.adb -O2 -g -gnatpg -gnata -mtune=pentiumpro -gnatO ada/g-os_lib.o /home/guerby/work/gcc/version-head/gcc/ada/g-os_lib.adb -o /tmp/cccG1GBc.s
Starting program: /home/guerby/work/gcc/build/build-20040912T182550/gcc/stage1/gnat1 -I- -I. -Iada -I/home/guerby/work/gcc/version-head/gcc/ada -quiet -dumpbase g-os_lib.adb -O2 -g -gnatpg -gnata -mtune=pentiumpro -gnatO ada/g-os_lib.o /home/guerby/work/gcc/version-head/gcc/ada/g-os_lib.adb -o /tmp/cccG1GBc.s
/home/guerby/work/gcc/version-head/gcc/ada/g-os_lib.adb: In function `GNAT.OS_LIB.TO_PATH_STRING_ACCESS':
/home/guerby/work/gcc/version-head/gcc/ada/g-os_lib.adb:2224: error: Definition in block 1 does not dominate use in block 8
for SSA_NAME: D.5632_4
in statement:
ivtmp.654D.6174_59 = &(*return_val$P_ARRAYD.6158_31)[2]{lb: D.5632_4 sz: 1};


Breakpoint 2, internal_error (msgid=0x87d8efd "verify_ssa failed.") at /home/guerby/work/gcc/version-head/gcc/diagnostic.c:543
543	  va_start (ap, msgid);
(gdb) bt
#0  internal_error (msgid=0x87d8efd "verify_ssa failed.") at /home/guerby/work/gcc/version-head/gcc/diagnostic.c:543
During symbol reading, Incomplete CFI data; unspecified registers at 0x08404c71.
During symbol reading, Incomplete CFI data; unspecified registers at 0x08404c71.
During symbol reading, Incomplete CFI data; unspecified registers at 0x08404c71.
During symbol reading, Incomplete CFI data; unspecified registers at 0x08404c71.
During symbol reading, Incomplete CFI data; unspecified registers at 0x08404c71.
During symbol reading, Incomplete CFI data; unspecified registers at 0x08404c71.
During symbol reading, Incomplete CFI data; unspecified registers at 0x08404c71.
#1  0x082f2a93 in verify_ssa () at /home/guerby/work/gcc/version-head/gcc/tree-ssa.c:612
During symbol reading, Incomplete CFI data; unspecified registers at 0x082f2a6f.
During symbol reading, Incomplete CFI data; unspecified registers at 0x082f2a6f.
During symbol reading, Incomplete CFI data; unspecified registers at 0x082f2a6f.
During symbol reading, Incomplete CFI data; unspecified registers at 0x082f2a6f.
During symbol reading, Incomplete CFI data; unspecified registers at 0x082f2a6f.
During symbol reading, Incomplete CFI data; unspecified registers at 0x082f2a6f.
During symbol reading, Incomplete CFI data; unspecified registers at 0x082f2a6f.
#2  0x0837bc6c in verify_loop_closed_ssa () at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-manip.c:376
During symbol reading, Incomplete CFI data; unspecified registers at 0x0837bc8d.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0837bc8d.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0837bc8d.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0837bc8d.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0837bc8d.
During symbol reading, Incomplete CFI data; unspecified registers at 0x0837bc8d.
#3  0x083958fd in tree_ssa_iv_optimize (loops=0x8db6310) at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-ivopts.c:4424
#4  0x08377249 in tree_ssa_loop_ivopts () at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop.c:308
#5  0x082f65f9 in execute_one_pass (pass=0x88678e0) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:501
#6  0x082f66e5 in execute_pass_list (pass=0x88678e0) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:536
#7  0x082f6703 in execute_pass_list (pass=0x8867720) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:537
#8  0x082f6703 in execute_pass_list (pass=0x88670a0) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:537
#9  0x082f6954 in tree_rest_of_compilation (fndecl=0x40353ae0, nested_p=0 '\0') at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:618
#10 0x0806f2b0 in gnat_expand_body (gnu_decl=0x40353ae0) at /home/guerby/work/gcc/version-head/gcc/ada/misc.c:652
#11 0x086edfec in cgraph_expand_function (node=0x4043ae0c) at /home/guerby/work/gcc/version-head/gcc/cgraphunit.c:814
#12 0x086efe42 in cgraph_expand_all_functions () at /home/guerby/work/gcc/version-head/gcc/cgraphunit.c:1680
#13 0x086f0130 in cgraph_optimize () at /home/guerby/work/gcc/version-head/gcc/cgraphunit.c:1770
#14 0x0806d7eb in gnat_parse_file (set_yydebug=0) at /home/guerby/work/gcc/version-head/gcc/ada/misc.c:240
#15 0x086783fc in compile_file () at /home/guerby/work/gcc/version-head/gcc/toplev.c:991
#16 0x08679de5 in do_compile () at /home/guerby/work/gcc/version-head/gcc/toplev.c:2096
#17 0x08679e4c in toplev_main (argc=18, argv=0xbffff2f4) at /home/guerby/work/gcc/version-head/gcc/toplev.c:2128
#18 0x082cd286 in main (argc=18, argv=0xbffff2f4) at /home/guerby/work/gcc/version-head/gcc/main.c:35
(gdb) f 3
#3  0x083958fd in tree_ssa_iv_optimize (loops=0x8db6310) at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-ivopts.c:4424
4424		  verify_loop_closed_ssa ();
(gdb) f 2
#2  0x0837bc6c in verify_loop_closed_ssa () at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop-manip.c:376
376	  verify_ssa ();
(gdb) f 1
#1  0x082f2a93 in verify_ssa () at /home/guerby/work/gcc/version-head/gcc/tree-ssa.c:612
612	  internal_error ("verify_ssa failed.");
(gdb) l
607	  free (definition_block);
608	  timevar_pop (TV_TREE_SSA_VERIFY);
609	  return;
610	
611	err:
612	  internal_error ("verify_ssa failed.");
613	}
614	
615	
616	/* Initialize global DFA and SSA structures.  */
(gdb) f 4
#4  0x08377249 in tree_ssa_loop_ivopts () at /home/guerby/work/gcc/version-head/gcc/tree-ssa-loop.c:308
308	  tree_ssa_iv_optimize (current_loops);
(gdb) f 5
#5  0x082f65f9 in execute_one_pass (pass=0x88678e0) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:501
501	    pass->execute ();


On x86_64, I got a SEGV while building the RTS


../../xgcc -B../../ -c -g -O2 -fPIC      -W -Wall -gnatpg  g-awk.adb -o g-awk.o
+===========================GNAT BUG DETECTED==============================+
| 4.0.0 20040912 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
| Segmentation fault                                                       |
| Error detected at g-awk.adb:1316:24                                      |

It is happening during garbage collection:

gt_ggc_mx_lang_tree_node
...
#139 0x00000000004271ea in gt_ggc_mx_lang_tree_node (x_p=Variable "x_p" is not available.
) at gtype-ada.h:185
#140 0x00000000004271ea in gt_ggc_mx_lang_tree_node (x_p=Variable "x_p" is not available.
) at gtype-ada.h:185
#141 0x00000000004271ea in gt_ggc_mx_lang_tree_node (x_p=Variable "x_p" is not available.
) at gtype-ada.h:185
#142 0x00000000007bc266 in gt_ggc_mx_dataflow_d (x_p=Variable "x_p" is not available.
) at gtype-desc.c:288
#143 0x00000000007c3c45 in gt_ggc_mx_tree_ann_d (x_p=Variable "x_p" is not available.
) at gtype-desc.c:365
#144 0x0000000000426f9a in gt_ggc_mx_lang_tree_node (x_p=Variable "x_p" is not available.
) at gtype-ada.h:162
#145 0x000000000042712a in gt_ggc_mx_lang_tree_node (x_p=Variable "x_p" is not available.
) at gtype-ada.h:178
#146 0x00000000007bc167 in gt_ggc_mx_varray_head_tag (x_p=Variable "x_p" is not available.
) at gtype-desc.c:533
#147 0x00000000007b7e6f in ggc_mark_roots () at /home/guerby/work/gcc/version-head/gcc/ggc-common.c:118
#148 0x0000000000960227 in ggc_collect () at /home/guerby/work/gcc/version-head/gcc/ggc-page.c:1968
#149 0x000000000065f37c in execute_todo (properties=732, flags=15) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:438
#150 0x000000000065f5a8 in execute_pass_list (pass=0x11bfb50) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:512
#151 0x000000000065f5d5 in execute_pass_list (pass=0xc55500) at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:537
#152 0x000000000065f855 in tree_rest_of_compilation (fndecl=0x2a96060e00, nested_p=0 '\0') at /home/guerby/work/gcc/version-head/gcc/tree-optimize.c:618
#153 0x000000000098df13 in cgraph_expand_function (node=0x2a95a85000) at /home/guerby/work/gcc/version-head/gcc/cgraphunit.c:814
#154 0x000000000098f842 in cgraph_optimize () at /home/guerby/work/gcc/version-head/gcc/cgraphunit.c:1680
#155 0x000000000093732f in toplev_main (argc=Variable "argc" is not available.
) at /home/guerby/work/gcc/version-head/gcc/toplev.c:991
#156 0x0000002a95688e5d in __libc_start_main () from /lib64/tls/libc.so.6
#157 0x000000000040297a in _start () at ../sysdeps/x86_64/elf/start.S:96
(gdb) f 1
#1  0x00000000007bbb88 in gt_ggc_mx_basic_block_def (x_p=Variable "x_p" is not available.
) at gtype-desc.c:429
429       while (ggc_test_and_set_mark (xlimit))

Laurent

On Sat, 2004-09-11 at 21:02, Zdenek Dvorak wrote:
> Hello,
> 
> > >     It would be usefull to know the backtraces at least here.  The
> > >     second
> > >     problem looks like yet another tree node sharing problem, so in
> > >     the
> > >     case the failure is within tree-ssa-loop-ivopts, I will try to add
> > >     more of unsave_exprs to uses that might result in sharing and lets
> > >     see
> > >     if it fix it.
> > > 
> > > I can confirm this is a loop issue because it doesn't happen when
> > > I disable loop optimizations.
> > 
> > I will try to add the unsaves to dubious places in ivops tomorrow then.
> > Ot helped in other cases with the same symptom.
> 
> could you please check whether this patch helps?
> 
> Zdenek
> 
> Index: tree-ssa-loop-ivopts.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ivopts.c,v
> retrieving revision 2.9
> diff -c -3 -p -r2.9 tree-ssa-loop-ivopts.c
> *** tree-ssa-loop-ivopts.c	10 Sep 2004 08:56:36 -0000	2.9
> --- tree-ssa-loop-ivopts.c	11 Sep 2004 17:15:30 -0000
> *************** static tree
> *** 1995,2004 ****
>   get_computation_at (struct loop *loop,
>   		    struct iv_use *use, struct iv_cand *cand, tree at)
>   {
> !   tree ubase = unsave_expr_now (use->iv->base);
> !   tree ustep = unsave_expr_now (use->iv->step);
> !   tree cbase = unsave_expr_now (cand->iv->base);
> !   tree cstep = unsave_expr_now (cand->iv->step);
>     tree utype = TREE_TYPE (ubase), ctype = TREE_TYPE (cbase);
>     tree uutype;
>     tree expr, delta;
> --- 2007,2016 ----
>   get_computation_at (struct loop *loop,
>   		    struct iv_use *use, struct iv_cand *cand, tree at)
>   {
> !   tree ubase = use->iv->base;
> !   tree ustep = use->iv->step;
> !   tree cbase = cand->iv->base;
> !   tree cstep = cand->iv->step;
>     tree utype = TREE_TYPE (ubase), ctype = TREE_TYPE (cbase);
>     tree uutype;
>     tree expr, delta;
> *************** iv_value (struct iv *iv, tree niter)
> *** 2905,2911 ****
>     tree type = TREE_TYPE (iv->base);
>   
>     niter = fold_convert (type, niter);
> !   val = fold (build2 (MULT_EXPR, type, iv->step, unsave_expr_now (niter)));
>   
>     return fold (build2 (PLUS_EXPR, type, iv->base, val));
>   }
> --- 2917,2923 ----
>     tree type = TREE_TYPE (iv->base);
>   
>     niter = fold_convert (type, niter);
> !   val = fold (build2 (MULT_EXPR, type, iv->step, niter));
>   
>     return fold (build2 (PLUS_EXPR, type, iv->base, val));
>   }
> *************** rewrite_use_outer (struct ivopts_data *d
> *** 4125,4130 ****
> --- 4137,4143 ----
>   	value = get_computation_at (data->current_loop,
>   				    use, cand, last_stmt (exit->src));
>   
> +       value = unshare_expr (value);
>         op = force_gimple_operand (value, &stmts, true, SSA_NAME_VAR (tgt));
>   	  
>         /* If we will preserve the iv anyway and we would need to perform
> 



More information about the Gcc mailing list