------- Comment #11 from spop at gcc dot gnu dot org 2007-06-24 06:48 ------- Subject: Re: [4.3 Regression] Segmentation fault in build_classic_dist_vector_1() at tree-data-ref.c:2700
Hi, On 6/23/07, Richard Guenther <[EMAIL PROTECTED]> wrote: > > First - can you check why the asociate: case in fold_binary does not do > > the transformation and maybe fix that instead if possible? > > The associate case is the last case for MINUS_EXPR, but the case /* A - B -> A + (-B) if B is easily negatable. */ applies, and returns ~(unsigned int) i_434 + (unsigned int) i_434 before going to execute the associate code. 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. > > + && integer_zerop (fold_build2 (MINUS_EXPR, type, arg0, > > + TREE_OPERAND (arg1, 0)))) > > > > to avoid creating trees and just throwing them away you should use > > operand_equal_p (arg0, TREE_OPERAND (arg1, 0)) instead. Hmm, this was my first implementation, as I just mimicked the code just before, that is using operand_equal_p. However in my case I have 'A' and 'nop(unsigned int, A)' so they are not exactly the same trees, but the difference is zero. > > You similarly may want to check operand 1 for A - (B + A)? > > yes, okay. > > + && TYPE_UNSIGNED (type) > > > > you should check TYPE_OVERFLOW_WRAPS (type) instead. > > Oh - and there is omit_two_operands which you should use to > omit the two As. This takes care of side-effects. > done. The attached patch bootstrapped and passed test on i686-linux. Sebastian ------- Comment #12 from spop at gcc dot gnu dot org 2007-06-24 06:48 ------- Created an attachment (id=13770) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13770&action=view) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32461