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: Handle a + ~a in reassoc


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
>>
>


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