This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR66726] Factor conversion out of COND_EXPR
- From: Kugan <kugan dot vivekanandarajah at linaro dot org>
- To: Jeff Law <law at redhat dot com>, Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 12 Jul 2015 21:24:45 +1000
- Subject: Re: [PR66726] Factor conversion out of COND_EXPR
- Authentication-results: sourceware.org; auth=none
- References: <55974BF2 dot 3060603 at linaro dot org> <20150704085143 dot GA14895 at nbbrfq dot cc dot univie dot ac dot at> <5597D24B dot 8010900 at linaro dot org> <559AF515 dot 6010700 at redhat dot com> <559BCB15 dot 9010209 at linaro dot org> <559BE505 dot 5070802 at redhat dot com> <559EFEE5 dot 6030006 at linaro dot org> <55A02DBF dot 6030608 at redhat dot com>
On 11/07/15 06:40, Jeff Law wrote:
> On 07/09/2015 05:08 PM, Kugan wrote:
>
>> Done. Bootstrapped and regression tested on x86-64-none-linux-gnu with
>> no new regressions. Is this OK for trunk?
> Thanks for the additional testcases.
>
>
>
>> + else
>> + {
>> + /* If arg1 is an INTEGER_CST, fold it to new type. */
>> + if (INTEGRAL_TYPE_P (TREE_TYPE (new_arg0))
>> + && int_fits_type_p (arg1, TREE_TYPE (new_arg0)))
>> + {
>> + if (gimple_assign_cast_p (arg0_def_stmt))
>> + new_arg1 = fold_convert (TREE_TYPE (new_arg0), arg1);
>> + else
>> + return false;
>> + }
>> + else
>> + return false;
>> + }
> Something looks goofy here formatting-wise. Can you please check for
> horizontal whitespace consistency before committing.
>
>
>
>> +
>> + /* If types of new_arg0 and new_arg1 are different bailout. */
>> + if (TREE_TYPE (new_arg0) != TREE_TYPE (new_arg1))
>> + return false;
> Seems like this should use types_compatible_p here. You're testing
> pointer equality, but as long as the types are compatible, we should be
> able to make the transformation.
>
> With the horizontal whitespace fixed and using types_compatible_p this
> is OK for the trunk. So pre-approved with those two changes and a final
> bootstrap/regression test (due to the types_compatible_p change).
>
> jeff
>
Thanks. Committed as r225722 with the changes. Also did a fresh
bootstrap and regression testing on x86_64-none-linux-gnu before committing.
Thanks,
Kugan