This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fold-const patch for PR41442
- From: Bernd Schmidt <bernds at codesourcery dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 28 Apr 2010 00:31:11 +0200
- Subject: Re: fold-const patch for PR41442
- References: <4BD32CDA.8080608@codesourcery.com> <4BD3F676.8030600@gnu.org>
On 04/25/2010 09:59 AM, Paolo Bonzini wrote:
> On 04/24/2010 07:39 PM, Bernd Schmidt wrote:
>> This implements the folding requested in PR41442, i.e.:
>>
>> if ((p1->next&& !p2->next) || p2->next)
>>
>> to
>>
>> if (p1->next || p2->next)
>>
>> Bootstrapped and regression tested on i686-linux. Ok?
>
> This would also apply for TRUTH_AND_EXPR and TRUTH_OR_EXPR, since you
> rule out side-effecting expressions, no?
It would, and also BIT_AND and BIT_IOR. I couldn't find a test case in
my collection of input files where it mattered, and I guess in the
absence of control flow it should probably be done in simplify-rtx.
Bernd