diff options
author | Jakub Jelinek <jakub@redhat.com> | 2023-06-16 19:46:36 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2023-06-16 19:46:36 +0200 |
commit | 5b67116a85298bbe358b036d34ad23119cebbdac (patch) | |
tree | 34294066c2edc62d95a70004a97d274e27ba16b8 /gcc/tree-vectorizer.h | |
parent | ea1cd66f2200839d46a8b4dc140d18c00b849c82 (diff) | |
download | gcc-5b67116a85298bbe358b036d34ad23119cebbdac.zip gcc-5b67116a85298bbe358b036d34ad23119cebbdac.tar.gz gcc-5b67116a85298bbe358b036d34ad23119cebbdac.tar.bz2 |
tree-ssa-math-opts: Fix up uaddc/usubc pattern matching [PR110271]
The following testcase ICEs, because I misremembered what the return value
from match_arith_overflow is. It isn't true if __builtin_*_overflow was
matched, but it is true only in the BIT_NOT_EXPR case if stmt was removed.
So, if match_arith_overflow matches something, gsi_stmt (gsi) will not
be stmt and match_uaddc_usubc will be confused and can ICE.
The following patch fixes it by checking if gsi_stmt (gsi) == stmt,
in that case we know it is still a PLUS_EXPR/MINUS_EXPR and we can try to
pattern match it further as UADDC/USUBC.
2023-06-16 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/110271
* tree-ssa-math-opts.cc (math_opts_dom_walker::after_dom_children)
<case PLUS_EXPR>: Ignore return value from match_arith_overflow,
instead call match_uaddc_usubc only if gsi_stmt (gsi) is still stmt.
* gcc.c-torture/compile/pr110271.c: New test.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions