diff options
author | Richard Biener <rguenther@suse.de> | 2021-10-14 09:00:25 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-10-14 14:58:40 +0200 |
commit | 9b2ad21ab3ebc21a3408108327fa1a7cbedaf217 (patch) | |
tree | d68d7cfd68cb20de58c40eed4a9702a27434701d /gcc/tree-data-ref.c | |
parent | 4cb52980e5d5fb64a393d385923da1b51ab34606 (diff) | |
download | gcc-9b2ad21ab3ebc21a3408108327fa1a7cbedaf217.zip gcc-9b2ad21ab3ebc21a3408108327fa1a7cbedaf217.tar.gz gcc-9b2ad21ab3ebc21a3408108327fa1a7cbedaf217.tar.bz2 |
tree-optimization/102659 - really avoid undef overflow in if-conversion
This plugs the remaining hole of POINTER_PLUS_EXPR with undefined
overflow. Unfortunately we have to go through some lengths to
not put invariant conversions into the loop body since that confuses
the vectorizers gather/scatter discovery which relies on identifying
an invariant component of plus and minus expressions. We can
emit those in the loop preheader but then we have to accept that
being non-empty when looking for the LOOP_VECTORIZED internal
function call in the vectorizer.
2021-10-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/102659
* tree-if-conv.c (if_convertible_gimple_assign_stmt_p): Also
rewrite pointer typed undefined overflow operations.
(predicate_statements): Likewise. Make sure to emit invariant
conversions in the preheader.
* tree-vectorizer.c (vect_loop_vectorized_call): Look through
non-empty preheaders.
* tree-data-ref.c (dr_analyze_indices): Strip useless
conversions to the MEM_REF base type.
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r-- | gcc/tree-data-ref.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 18307a5..57bac06 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -1370,6 +1370,7 @@ dr_analyze_indices (struct indices *dri, tree ref, edge nest, loop_p loop) tree op = TREE_OPERAND (ref, 0); tree access_fn = analyze_scalar_evolution (loop, op); access_fn = instantiate_scev (nest, loop, access_fn); + STRIP_NOPS (access_fn); if (TREE_CODE (access_fn) == POLYNOMIAL_CHREC) { tree memoff = TREE_OPERAND (ref, 1); |