This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Some VRP improvements


Diego Novillo <dnovillo@redhat.com> writes:

> On Thu, Jun 02, 2005 at 07:11:22AM +0200, Andreas Jaeger wrote:
>> 
>> Thanks for the large patch.  Unfortunately, it does not work for Ada,
>> I get this error now:
>> 
>> aised TYPES.UNRECOVERABLE_ERROR : comperr.adb:381
>> make[2]: *** [ada/butil.o] Error 1
>> make[2]: *** Waiting for unfinished jobs....
>>
> Seems to be another instance of an FE emitting a comparison
> between a pointer and a non-pointer.  Fortran was doing the same
> and C is doing the same (PR 21858).
>
> I am *very* tempted to turn that assert into either a warning or
> a silent ignore.  Show me val1 and val2 at that point?  Also if
> you go 1 or 2 slots up in the backtrace, you should be able to
> see the original predicate.

(gdb) pt val1
 <modify_expr 0x2aaaaaeb3280
    type <pointer_type 0x2aaaaadfe5b0
        type <void_type 0x2aaaaadfe4e0 void sizes-gimplified visited VOID
            align 8 symtab 0 alias set -1
            pointer_to_this <pointer_type 0x2aaaaadfe5b0>>
        public unsigned DI
        size <integer_cst 0x2aaaaadeac00 constant invariant 64>
        unit size <integer_cst 0x2aaaaadeac30 constant invariant 8>
        align 64 symtab 0 alias set -1>
    side-effects asm_written visited
    arg 0 <ssa_name 0x2aaaab1d7b60 type <pointer_type 0x2aaaaadfe5b0>
        visited var <var_decl 0x2aaaaaeb2680 D.869> def_stmt <modify_expr 0x2aaaaaeb3280>
        version 70
        ptr-info 0x2aaaaaed0b60>
    arg 1 <call_expr 0x2aaaaaeb3190 type <pointer_type 0x2aaaaadfe5b0>
        nothrow
        arg 0 <addr_expr 0x2aaaaaeb1d40 type <pointer_type 0x2aaaaae8dd00>
            constant invariant arg 0 <function_decl 0x2aaaaae050d0 __builtin_memcmp>>
        arg 1 <tree_list 0x2aaaaaeaa4b0
            value <addr_expr 0x2aaaaaeb1d00 type <pointer_type 0x2aaaaaeb2410>
                constant invariant
                arg 0 <string_cst 0x2aaaaae83f90 type <array_type 0x2aaaaae92410 butil__is_predefined_unit__T15b>
                    "ada.">>
            chain <tree_list 0x2aaaaaeaa480
                value <ssa_name 0x2aaaab1d7af0 type <pointer_type 0x2aaaaaeb2410>
                    visited var <var_decl 0x2aaaaaeb25b0 D.868> def_stmt <modify_expr 0x2aaaaaeb3230>
                    version 69
                    ptr-info 0x2aaaaaed0b20>
                chain <tree_list 0x2aaaaaeaa450
                    value <integer_cst 0x2aaaaadea570 constant invariant 4>>>>
        /cvs/gcc/gcc/ada/butil.adb:66>
    /cvs/gcc/gcc/ada/butil.adb:66>
(gdb) pt val2
 <modify_expr 0x2aaaaaeb3280
    type <pointer_type 0x2aaaaadfe5b0
        type <void_type 0x2aaaaadfe4e0 void sizes-gimplified visited VOID
            align 8 symtab 0 alias set -1
            pointer_to_this <pointer_type 0x2aaaaadfe5b0>>
        public unsigned DI
        size <integer_cst 0x2aaaaadeac00 constant invariant 64>
        unit size <integer_cst 0x2aaaaadeac30 constant invariant 8>
        align 64 symtab 0 alias set -1>
    side-effects asm_written visited
    arg 0 <ssa_name 0x2aaaab1d7b60 type <pointer_type 0x2aaaaadfe5b0>
        visited var <var_decl 0x2aaaaaeb2680 D.869> def_stmt <modify_expr 0x2aaaaaeb3280>
        version 70
        ptr-info 0x2aaaaaed0b60>
    arg 1 <call_expr 0x2aaaaaeb3190 type <pointer_type 0x2aaaaadfe5b0>
        nothrow
        arg 0 <addr_expr 0x2aaaaaeb1d40 type <pointer_type 0x2aaaaae8dd00>
            constant invariant arg 0 <function_decl 0x2aaaaae050d0 __builtin_memcmp>>
        arg 1 <tree_list 0x2aaaaaeaa4b0
            value <addr_expr 0x2aaaaaeb1d00 type <pointer_type 0x2aaaaaeb2410>
                constant invariant
                arg 0 <string_cst 0x2aaaaae83f90 type <array_type 0x2aaaaae92410 butil__is_predefined_unit__T15b>
                    "ada.">>
            chain <tree_list 0x2aaaaaeaa480
                value <ssa_name 0x2aaaab1d7af0 type <pointer_type 0x2aaaaaeb2410>
                    visited var <var_decl 0x2aaaaaeb25b0 D.868> def_stmt <modify_expr 0x2aaaaaeb3230>
                    version 69
                    ptr-info 0x2aaaaaed0b20>
                chain <tree_list 0x2aaaaaeaa450
                    value <integer_cst 0x2aaaaadea570 constant invariant 4>>>>
        /cvs/gcc/gcc/ada/butil.adb:66>
    /cvs/gcc/gcc/ada/butil.adb:66>
(gdb) up
#3  0x0000000000eec43d in compare_name_with_value (comp=EQ_EXPR, var=0x2aaaab1d7b60, val=0x2aaaaae00270)
    at /cvs/gcc/gcc/tree-vrp.c:2837
2837          t = compare_range_with_value (comp, &equiv_vr, val);
(gdb) p equiv_vr
$4 = {type = VR_RANGE, min = 0x2aaaab1d7b60, max = 0x2aaaab1d7b60, equiv = 0x1a15338}

(gdb) bt
#0  fancy_abort (file=0x130c464 "/cvs/gcc/gcc/tree-vrp.c", line=485, function=0x130c566 "compare_values")
    at /cvs/gcc/gcc/diagnostic.c:588
#1  0x0000000000ee5bac in compare_values (val1=0x2aaaab1d7b60, val2=0x2aaaaae00270) at /cvs/gcc/gcc/tree-vrp.c:484
#2  0x0000000000ee9068 in compare_range_with_value (comp=EQ_EXPR, vr=0x7fffffffe570, val=0x2aaaaae00270)
    at /cvs/gcc/gcc/tree-vrp.c:1690
#3  0x0000000000eec43d in compare_name_with_value (comp=EQ_EXPR, var=0x2aaaab1d7b60, val=0x2aaaaae00270)
    at /cvs/gcc/gcc/tree-vrp.c:2837
#4  0x0000000000eecdc7 in vrp_evaluate_conditional (cond=0x2aaaaaeb31e0, use_equiv_p=1 '\001')
    at /cvs/gcc/gcc/tree-vrp.c:3001
#5  0x000000000073f557 in fold_predicate_in (stmt=0x2aaaaaeaf6e0) at /cvs/gcc/gcc/tree-ssa-propagate.c:1031
#6  0x000000000073f86c in substitute_and_fold (prop_value=0x1a585a0, use_ranges_p=1 '\001')
    at /cvs/gcc/gcc/tree-ssa-propagate.c:1111
#7  0x0000000000eede82 in vrp_finalize () at /cvs/gcc/gcc/tree-vrp.c:3450
#8  0x0000000000eedf84 in execute_vrp () at /cvs/gcc/gcc/tree-vrp.c:3520
#9  0x0000000000679a14 in execute_one_pass (pass=0x1526860) at /cvs/gcc/gcc/tree-optimize.c:623
#10 0x0000000000679afb in execute_pass_list (pass=0x1526860) at /cvs/gcc/gcc/tree-optimize.c:660
#11 0x0000000000679b17 in execute_pass_list (pass=0x1523200) at /cvs/gcc/gcc/tree-optimize.c:661
#12 0x0000000000679ef6 in tree_rest_of_compilation (fndecl=0x2aaaaae7a820) at /cvs/gcc/gcc/tree-optimize.c:793
#13 0x000000000042ee6e in gnat_expand_body (gnu_decl=0x2aaaaae7a820) at /cvs/gcc/gcc/ada/misc.c:635
#14 0x0000000000f4b540 in cgraph_expand_function (node=0x2aaaaae7bb60) at /cvs/gcc/gcc/cgraphunit.c:954
#15 0x0000000000f4b7d9 in cgraph_expand_all_functions () at /cvs/gcc/gcc/cgraphunit.c:1020
#16 0x0000000000f4bd1d in cgraph_optimize () at /cvs/gcc/gcc/cgraphunit.c:1153
#17 0x000000000042d1ee in gnat_parse_file (set_yydebug=0) at /cvs/gcc/gcc/ada/misc.c:245
#18 0x0000000000e8d880 in compile_file () at /cvs/gcc/gcc/toplev.c:966
#19 0x0000000000e8eff0 in do_compile () at /cvs/gcc/gcc/toplev.c:1903
#20 0x0000000000e8f052 in toplev_main (argc=18, argv=0x7fffffffeac8) at /cvs/gcc/gcc/toplev.c:1935
#21 0x000000000066accb in main (argc=18, argv=0x7fffffffeac8) at /cvs/gcc/gcc/main.c:35

Does this help?
Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]