Handle a + ~a in reassoc

Richard Guenther richard.guenther@gmail.com
Thu Apr 15 09:00:00 GMT 2010


On Wed, Apr 14, 2010 at 6:29 PM, Alexander Monakov <amonakov@ispras.ru> wrote:
>
>
> On Wed, 14 Apr 2010, Richard Guenther wrote:
>
>>
>> Btw, did you check where and why we generate the ~a in the first
>> place?  It appears in the .original dump for your testcase.  I suppose
>> this is a folding from the pre-tree-ssa days and nowadays should
>> be done during/before expansion or by combine.
>
> fold-const.c:10773 does the folding.  It was added as one of the fixes for
> PR15784 in March 2005 (thus after the tree-ssa merge).

Ok, well.  I guess the reassoc change is ok then, with the following
adjustment:

+         add_to_ops_vec (ops,
+                         build_low_bits_mask (op_type,
+                                              TYPE_PRECISION (op_type)));
+         VEC_ordered_remove (operand_entry_t, *ops, currindex);

this isn't correct for signed integers.  Instead use
build_int_cst_type (op_type, -1).

Thanks,
Richard.

>>
>> Richard.
>>
>> > Thanks.
>> > Alexander Monakov
>>
>



More information about the Gcc-patches mailing list