CFT: tuple changes for ADA

Laurent GUERBY laurent@guerby.net
Sun Nov 12 14:33:00 GMT 2006


It looks like the failure does not go away with your patch.

Laurent

(gdb) bt
#0  0x00002ad69eae00f0 in strlen () from /lib/libc.so.6
#1  0x000000000096e5dd in pp_base_string (pp=0x137e010, str=0x101040101010100 <Address 0x101040101010100 out of bounds>)
    at ../../gimple-tuples-branch/gcc/pretty-print.c:804
#2  0x000000000096f20a in pp_base_format (pp=0x137e010, text=0x7fff0c4d7dd0) at ../../gimple-tuples-branch/gcc/pretty-print.c:449
#3  0x000000000096fd91 in pp_base_format_verbatim (pp=0x101040101010100, text=0x101040101010100) at ../../gimple-tuples-branch/gcc/pretty-print.c:585
#4  0x000000000041df12 in internal_error_function (msgid=0xc4dd28 "tree check: expected class %qs, have %qs (%s) in %s, at %s:%d", ap=0x7fff0c4d7ee0)
    at ../../gimple-tuples-branch/gcc/ada/misc.c:391
#5  0x0000000000710a41 in diagnostic_report_diagnostic (context=0x12dfdc0, diagnostic=0x7fff0c4d7ea0) at ../../gimple-tuples-branch/gcc/diagnostic.c:195
#6  0x0000000000710c9e in internal_error (gmsgid=<value optimized out>) at ../../gimple-tuples-branch/gcc/diagnostic.c:588
#7  0x0000000000941019 in tree_class_check_failed (node=0x2ad69ed708c0, cl=tcc_gimple_stmt, file=<value optimized out>, line=541, 
    function=0xba202e "get_rhs") at ../../gimple-tuples-branch/gcc/tree.c:6411
#8  0x00000000006adca0 in get_rhs (stmt=0x101040101010100) at ../../gimple-tuples-branch/gcc/tree-ssa-propagate.c:541
#9  0x0000000000a12ca7 in fold_stmt (stmt_p=0x2ad69ed67810) at ../../gimple-tuples-branch/gcc/tree-ssa-ccp.c:2368
#10 0x00000000009f2716 in remove_useless_stmts_1 (tp=0x101040101010100, data=0x7fff0c4d8130) at ../../gimple-tuples-branch/gcc/tree-cfg.c:1880
#11 0x00000000009f2797 in remove_useless_stmts_1 (tp=<value optimized out>, data=0x7fff0c4d8130) at ../../gimple-tuples-branch/gcc/tree-cfg.c:1903
#12 0x00000000009f2938 in remove_useless_stmts_1 (tp=0x2ad69ed5e190, data=0x7fff0c4d8130) at ../../gimple-tuples-branch/gcc/tree-cfg.c:1726
#13 0x00000000009f33fc in remove_useless_stmts () at ../../gimple-tuples-branch/gcc/tree-cfg.c:1937
#14 0x00000000009720ed in execute_one_pass (pass=0xe751e0) at ../../gimple-tuples-branch/gcc/passes.c:870
#15 0x000000000097225c in execute_pass_list (pass=0xe751e0) at ../../gimple-tuples-branch/gcc/passes.c:917
#16 0x000000000065ac28 in tree_lowering_passes (fn=<value optimized out>) at ../../gimple-tuples-branch/gcc/tree-optimize.c:370
#17 0x00000000009d0928 in cgraph_lower_function (node=0x2ad69ed61d80) at ../../gimple-tuples-branch/gcc/cgraphunit.c:457
#18 0x00000000009d1834 in cgraph_analyze_function (node=0x2ad69ed61d80) at ../../gimple-tuples-branch/gcc/cgraphunit.c:948
#19 0x00000000009d1e78 in cgraph_finalize_function (decl=0x2ad69ed5e0e0, nested=0 '\0') at ../../gimple-tuples-branch/gcc/cgraphunit.c:486
#20 0x000000000043be12 in gnat_to_gnu (gnat_node=1658) at ../../gimple-tuples-branch/gcc/ada/trans.c:1569
#21 0x0000000000443319 in Compilation_Unit_to_gnu (gnat_node=1643) at ../../gimple-tuples-branch/gcc/ada/trans.c:2540
#22 0x0000000000445091 in gigi (gnat_root=16843008, max_gnat_node=<value optimized out>, number_name=<value optimized out>, 
    nodes_ptr=<value optimized out>, next_node_ptr=<value optimized out>, prev_node_ptr=<value optimized out>, elists_ptr=0x13a09b0, elmts_ptr=0x13a1000, 
    strings_ptr=0x13fd950, string_chars_ptr=0x13fb230, list_headers_ptr=0x1418740, number_units=2, file_info_ptr=0x7fff0c4d84f0 "O��\021", 
    standard_integer=62, standard_long_long_float=92, standard_exception_type=1217, gigi_operating_mode=0) at ../../gimple-tuples-branch/gcc/ada/trans.c:247
#23 0x000000000065033e in back_end.call_back_end (mode=back_end__generate_object) at ../../gimple-tuples-branch/gcc/ada/back_end.adb:109
#24 0x0000000000650d1e in gnat1drv () at ../../gimple-tuples-branch/gcc/ada/gnat1drv.adb:626
#25 0x000000000041de3d in gnat_parse_file (set_yydebug=<value optimized out>) at ../../gimple-tuples-branch/gcc/ada/misc.c:249
#26 0x000000000093f18e in toplev_main (argc=<value optimized out>, argv=<value optimized out>) at ../../gimple-tuples-branch/gcc/toplev.c:1033
#27 0x00002ad69ea880c4 in __libc_start_main () from /lib/libc.so.6
#28 0x0000000000403b69 in _start ()
(gdb) f 9
#9  0x0000000000a12ca7 in fold_stmt (stmt_p=0x2ad69ed67810) at ../../gimple-tuples-branch/gcc/tree-ssa-ccp.c:2368
2368      rhs = get_rhs (stmt);
(gdb) p debug_tree(stmt)
 <gimple_modify_stmt 0x2ad69ed6eae0 side-effects
    arg 0 <var_decl 0x2ad69ed6f370 A.2
        type <record_type 0x2ad69ed654d0 varsize_temp__local_message_t sizes-gimplified BLK size <var_decl 0x2ad69ed6f210 iftmp.0> unit size <var_decl 0x2ad69ed6f2c0 iftmp.1>
            align 32 symtab 0 alias set 0 fields <field_decl 0x2ad69ed61a80 length>
            Ada size <cond_expr 0x2ad69ed66a00 type <integer_type 0x2ad69ecbb0b0 bit_size_type>
               
                arg 0 <eq_expr 0x2ad69ed669b0 type <integer_type 0x2ad69ecbb4d0 integer>
                   
                    arg 0 <nop_expr 0x2ad69ed59540 type <integer_type 0x2ad69ed4d6e0 natural___XDLU_0__2147483647>
                        readonly arg 0 <parm_decl 0x2ad69ed5d280 nbytes>>
                    arg 1 <integer_cst 0x2ad69ed57f90 constant invariant 0>>
                arg 1 <integer_cst 0x2ad69ecaeba0 constant invariant 32>
                arg 2 <integer_cst 0x2ad69ecaed50 constant invariant 64>>
            pointer_to_this <pointer_type 0x2ad69ed65bb0> chain <type_decl 0x2ad69ed68000 varsize_temp__local_message_t>>
        addressable used ignored BLK file /home/guerby/tmp/gimple-tuples-branch/gcc/testsuite/gnat.dg/varsize_temp.adb line 26 size <integer_cst 0x2ad69ecaed50 64>
        unit size <integer_cst 0x2ad69ecaed80 constant invariant 8>
        align 32 context <function_decl 0x2ad69ed5e0e0 varsize_temp>
        chain <type_decl 0x2ad69ed60750 varsize_temp__message_t type <record_type 0x2ad69ed5c6e0 varsize_temp__message_t>
            VOID file /home/guerby/tmp/gimple-tuples-branch/gcc/testsuite/gnat.dg/varsize_temp.adb line 5
            align 1 context <function_decl 0x2ad69ed5e0e0 varsize_temp> chain <function_decl 0x2ad69ed5e1c0 varsize_temp__message_tD2>>>
    arg 1 <with_size_expr 0x2ad69ed708c0 type <record_type 0x2ad69ed654d0 varsize_temp__local_message_t>
        side-effects
        arg 0 <call_expr 0x2ad69ed700a0 type <record_type 0x2ad69ed654d0 varsize_temp__local_message_t>
            side-effects
            arg 0 <addr_expr 0x2ad69ed6de80 type <pointer_type 0x2ad69ed6f160>
                constant invariant arg 0 <function_decl 0x2ad69ed5e540 varsize_temp__one_message>>
            arg 2 <addr_expr 0x2ad69ed7b1c0 type <pointer_type 0x2ad69ed78e70>
                invariant arg 0 <var_decl 0x2ad69ed78dc0 FRAME.18>>
            /home/guerby/tmp/gimple-tuples-branch/gcc/testsuite/gnat.dg/varsize_temp.adb:26>
        arg 1 <var_decl 0x2ad69ed7c6e0 D.1119 type <integer_type 0x2ad69ecbb000 long int>
            used ignored DI file /home/guerby/tmp/gimple-tuples-branch/gcc/testsuite/gnat.dg/varsize_temp.adb line 27 size <integer_cst 0x2ad69ecaed50 64> unit size <integer_cst 0x2ad69ecaed80 8>
            align 64 context <function_decl 0x2ad69ed5e0e0 varsize_temp> chain <var_decl 0x2ad69ed6f210 iftmp.0>>>
    /home/guerby/tmp/gimple-tuples-branch/gcc/testsuite/gnat.dg/varsize_temp.adb:26>
$5 = void


$ svn diff tree-ssa-propagate.c
Index: tree-ssa-propagate.c
===================================================================
--- tree-ssa-propagate.c        (revision 118663)
+++ tree-ssa-propagate.c        (working copy)
@@ -536,7 +536,7 @@
       /* FALLTHRU */
 
     case GIMPLE_MODIFY_STMT:
-      stmt = GIMPLE_STMT_OPERAND (stmt, 1);
+      stmt = PROTECTED_TREE_OPERAND (stmt, 1);
       if (TREE_CODE (stmt) == WITH_SIZE_EXPR)
        return GIMPLE_STMT_OPERAND (stmt, 0);
       else


On Sun, 2006-11-12 at 05:21 -0400, Aldy Hernandez wrote:
> > I bootstraped c,ada on x86_64-linux on gimple-tuples-branch (r118663)
> > and no major breakage Ada-wise:
> 
> Sweet!
> 
> > #8  0x00000000006ada8c in get_rhs (stmt=0x101040101010100) at ../../gimple-tuples-branch/gcc/tree-ssa-propagate.c:541
> 
> Let me know if the patch below fixes it.
> 
> Thank you very much for taking a look at this.
> 
> Aldy
> 
> Index: tree-ssa-propagate.c
> ===================================================================
> --- tree-ssa-propagate.c        (revision 118179)
> +++ tree-ssa-propagate.c        (working copy)
> @@ -536,7 +536,7 @@ get_rhs (tree stmt)
>        /* FALLTHRU */
> 
>      case GIMPLE_MODIFY_STMT:
> -      stmt = GIMPLE_STMT_OPERAND (stmt, 1);
> +      stmt = PROTECTED_TREE_OPERAND (stmt, 1);
>        if (TREE_CODE (stmt) == WITH_SIZE_EXPR)
>         return GIMPLE_STMT_OPERAND (stmt, 0);
>        else
> 



More information about the Gcc-patches mailing list