[PR66726] Fixe regression caused by Factor conversion out of COND_EXPR

Jeff Law law@redhat.com
Mon Feb 8 16:49:00 GMT 2016


On 01/18/2016 08:52 PM, Kugan wrote:
> Hi,
>
> This is an updated version of
> https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02196.html.
>
> Patch to fix PR66726 missed optimization, factor conversion out of
> COND_EXPR caused a regression for targets with branch cost greater than
> i.e., testcase gcc.dg/pr46309.c failed for these targets. I posted a
> patch for this which had some issues. Please find an updated version of
> this patch that now passes regression.
>
> This patch makes optimize_range_tests understand the factored out
> COND_EXPR. i.e., Updated the final_range_test_p to look for the new
> pattern. Changed the maybe_optimize_range_tests (which does the inter
> basic block range test optimization) accordingly.
>
> Bootstrapped and regression tested on x86_64-none-linux-gnu with no new
> regressions. And also regression tested on arm-none-linux-gnu and
> aarch64-none-linux-gnu with no new regressions.
> Is this Ok for trunk?
>
> Thanks,
> Kugan
>
>
> gcc/ChangeLog:
>
> 2016-01-19  Kugan Vivekanandarajah  <kuganv@linaro.org>
>
> 	PR middle-end/66726
> 	* tree-ssa-reassoc.c (optimize_range_tests): Handle tcc_compare stmt
> 	whose result is used in PHI.
> 	(maybe_optimize_range_tests): Likewise.
> 	(final_range_test_p): Lokweise.
>
s/Lokeweise/Likewise/ in the ChangeLog entry.

Otherwise this looks OK for the trunk.  It really hasn't changed much 
since the version from July.  And while the PR is not marked as such, 
this is a code quality regression fix for targets with a BRANCH_COST > 1.

Thanks for your patience and not letting this get lost.

Jeff



More information about the Gcc-patches mailing list