------- Comment #20 from richard dot guenther at gmail dot com  2007-06-24 
11:40 -------
Subject: Re:  [4.3 Regression] Segmentation fault in
build_classic_dist_vector_1() at tree-data-ref.c:2700

On 6/24/07, Sebastian Pop <[EMAIL PROTECTED]> wrote:
> On 6/24/07, Sebastian Pop <[EMAIL PROTECTED]> wrote:
> > Unfortunately I haven't seen the suggestion of HÃ¥kan Hjort to also
> > implement the fold of ~a + a ==> ~0.  I could add a new patch for this
> > one too in the next bootstrap if the current patch still has issues.
> >
>
> I just realized that we already implement this:
>           /* ~X + X is -1.  */
>           /* X + ~X is -1.  */
>
> But, in our case, when we arrive at this point, it is useless because
> it uses operand_equal_p, so the above test fails, and we don't enter
> that code:
>
>           /* ~X + X is -1.  */
>           if (TREE_CODE (arg0) == BIT_NOT_EXPR
>               && operand_equal_p (TREE_OPERAND (arg0, 0), arg1, 0)
>               && !TYPE_OVERFLOW_TRAPS (type))
>             {
>               t1 = build_int_cst_type (type, -1);
>               return omit_one_operand (type, t1, arg1);
>             }

If you use TREE_OPERAND (op0, 0), op1 instead it should work.  The
problem seems to be that arg0/arg1 have all NOPs stripped, including
those changing the sign.  So we get to compare a and (unsigned)a,
which are obviously not the same.

It looks like most of the users of the arg variants are suspicious in this
regard...

Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32461

Reply via email to