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: [PATCH] Fix extract_range_from_cond (PR tree-optimization/19060)


On Fri, 14 Jan 2005, Roger Sayle wrote:
> On Fri, 7 Jan 2005, Jakub Jelinek wrote:
> > 2005-01-07  Jakub Jelinek  <jakub@redhat.com>
> >
> > 	PR tree-optimization/19060
> > 	* tree-ssa-dom.c (extract_range_from_cond) <case LT_EXPR, GT_EXPR>:
> > 	Return 0 if op1 <= TYPE_MIN_VALUE () resp. op1 >= TYPE_MAX_VALUE ().
> > 	(simplify_cond_and_lookup_avail_expr): Add assert for dummy == 0
> > 	and handle extract_range_from_cond returning false.
> > 	* fold-const.c (fold): Optimize comparisons with min/max even for
> > 	width > HOST_BITS_PER_WIDE_INT.
> >
> > 	* gcc.c-torture/execute/20050104-1.c: New test.
>
> This is OK for mainline...


Unfortunately, this patch breaks bootstrap on i686-pc-linux-gnu.  The
gcc_unreachable assertion triggers when extract_range_from_cond returns
false compiling __mulvdi3 from libgcc.  At this point the element's
condition is

 <lt_expr 0xb71b20d8
    type <boolean_type 0xb72b7798 _Bool public unsigned QI
        size <integer_cst 0xb72af210 constant invariant 8>
        unit size <integer_cst 0xb72af228 constant invariant 1>
        align 8 symtab 0 alias set -1 precision 1
        min <integer_cst 0xb72af600 0>
        max <integer_cst 0xb72af630 1>>
    arg 0 <ssa_name 0xb71a2384
        type <integer_type 0xb718be58 SItype public SI
            size <integer_cst 0xb72af408 constant invariant 32>
            unit size <integer_cst 0xb72af198 constant invariant 4>
            align 32 symtab 0 alias set -1 precision 32
            min <integer_cst 0xb72af3c0 -2147483648>
            max <integer_cst 0xb72af3d8 2147483647>>
        visited var <var_decl 0xb71949b4> def_stmt <modify_expr 0xb7197894>
        version 14>
    arg 1 <integer_cst 0xb72afa20 type <integer_type 0xb72b7510 int>
        constant invariant 0>>

The comparison of the signed ssa_name is against zero, which is not the
minimum value of the it's type's range.

Roger
--


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