aboutsummaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2023-09-21 03:05:17 +0000
committerAndrew Pinski <pinskia@gmail.com>2023-09-26 14:55:01 +0000
commit68fa82e2d8f868a233103102dff2449a416bc566 (patch)
treee2922a8de96fb489890afba24d1861d28d9c5c8c /gcc/system.h
parent277456180ea4d002675a9498a7b1ec9d483ded73 (diff)
downloadgcc-68fa82e2d8f868a233103102dff2449a416bc566.zip
gcc-68fa82e2d8f868a233103102dff2449a416bc566.tar.gz
gcc-68fa82e2d8f868a233103102dff2449a416bc566.tar.bz2
PHIOPT: Fix minmax_replacement for three way
So when diamond bb support was added to minmax_replacement in r13-1950-g9bb19e143cfe, the code was not expecting the alt_middle_bb not to exist if it was empty (for threeway_p). So when factor_out_conditional_conversion was used to factor out conversions, it turns out the assumption for alt_middle_bb to be wrong and we ended up with threeway_p being true but having middle_bb being empty but alt_middle_bb not being empty which causes wrong code in many cases. This patch fixes the issue by adding a test for the 2 cases where the assumption on threeway_p case having the other bb being empty. Changes made: v2: Fix test for `(a <= u) b = MAX(a, d) else b = u`. Note my plan for GCC 15 is remove minmax_replacement as match.pd will catch all cases at that point. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/111469 gcc/ChangeLog: * tree-ssa-phiopt.cc (minmax_replacement): Fix the assumption for the `non-diamond` handling cases of diamond code. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/pr111469-1.c: New test.
Diffstat (limited to 'gcc/system.h')
0 files changed, 0 insertions, 0 deletions