diff options
author | Richard Biener <rguenther@suse.de> | 2014-09-05 08:23:32 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-09-05 08:23:32 +0000 |
commit | f65586dcd19846071fd94fed4fb1bf91843887d1 (patch) | |
tree | 8e4e5406e368bf468ff117207d295e346a08f02a /gcc/c-family/c-format.c | |
parent | aaea00aa78750b8294842dd07fdf6a426e1c48b2 (diff) | |
download | gcc-f65586dcd19846071fd94fed4fb1bf91843887d1.tar.gz |
re PR tree-optimization/63148 (r187042 causes auto-vectorization failure for X86 for -m32.)
2014-09-05 Richard Biener <rguenther@suse.de>
PR middle-end/63148
* fold-const.c (try_move_mult_to_index): Remove.
(fold_binary_loc): Do not call it.
* tree-data-ref.c (dr_analyze_indices): Strip conversions
from the base object again.
c-family/
* c-format.c (check_format_arg): Properly handle
effectively signed POINTER_PLUS_EXPR offset.
* gcc.dg/vect/pr63148.c: New testcase.
* c-c++-common/pr19807-1.c: Likewise.
* g++.dg/tree-ssa/pr19807.C: Adjust.
* g++.dg/tree-ssa/tmmti-2.C: Remove.
From-SVN: r214941
Diffstat (limited to 'gcc/c-family/c-format.c')
-rw-r--r-- | gcc/c-family/c-format.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c index 129be6e191c..6b0bbce84f1 100644 --- a/gcc/c-family/c-format.c +++ b/gcc/c-family/c-format.c @@ -1473,12 +1473,13 @@ check_format_arg (void *ctx, tree format_tree, res->number_non_literal++; return; } - if (!tree_fits_shwi_p (arg1) - || (offset = tree_to_shwi (arg1)) < 0) + /* POINTER_PLUS_EXPR offsets are to be interpreted signed. */ + if (!cst_and_fits_in_hwi (arg1)) { res->number_non_literal++; return; } + offset = int_cst_value (arg1); } if (TREE_CODE (format_tree) != ADDR_EXPR) { @@ -1524,6 +1525,11 @@ check_format_arg (void *ctx, tree format_tree, && tree_fits_shwi_p (TREE_OPERAND (format_tree, 1)) && (offset += tree_to_shwi (TREE_OPERAND (format_tree, 1))) >= 0) format_tree = TREE_OPERAND (format_tree, 0); + if (offset < 0) + { + res->number_non_literal++; + return; + } if (TREE_CODE (format_tree) == VAR_DECL && TREE_CODE (TREE_TYPE (format_tree)) == ARRAY_TYPE && (array_init = decl_constant_value (format_tree)) != format_tree |