This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/2] Enable elimination of zext/sext
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Kugan <kugan dot vivekanandarajah at linaro dot org>
- Date: Mon, 1 Sep 2014 10:54:16 +0200
- Subject: Re: [PATCH 2/2] Enable elimination of zext/sext
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4aAN3KnSHzNyLckHiNBj1wiwNvih9hCymP8fbWmiNNA9g at mail dot gmail dot com> <CAFiYyc0jnw=F-te2Ba1b77cak3_VofY7SEgYBMpTGgTtVRkJzQ at mail dot gmail dot com> <CAFULd4at+CWZ_s-CKCg7o_dA7BdqC6db1fRGuKmtvpYnjQVzgg at mail dot gmail dot com> <20140901084758 dot GI17454 at tucnak dot redhat dot com>
On Mon, Sep 1, 2014 at 10:47 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Aug 27, 2014 at 12:25:14PM +0200, Uros Bizjak wrote:
>> Something like following (untested) patch that also fixes the testcase perhaps?
>>
>> -- cut here--
>> Index: cfgexpand.c
>> ===================================================================
>> --- cfgexpand.c (revision 214445)
>> +++ cfgexpand.c (working copy)
>> @@ -3322,6 +3322,7 @@ expand_gimple_stmt_1 (gimple stmt)
>>
>> if ((SUBREG_PROMOTED_GET (target) == SRP_SIGNED_AND_UNSIGNED)
>> && (GET_CODE (temp) == SUBREG)
>> + && SUBREG_PROMOTED_VAR_P (temp)
>> && (GET_MODE (target) == GET_MODE (temp))
>> && (GET_MODE (SUBREG_REG (target)) == GET_MODE
>> (SUBREG_REG (temp))))
>
> Looks like a wrong order of the predicates in any case, first you should
> check if it is a SUBREG, then SUBREG_PROMOTED_VAR_P and only then
> SUBREG_PROMOTED_GET. Also, the extra ()s around single line conditions
> are unnecessary.
This comment applies to the original code, not the patched line, I guess.
Uros.