Hi,
Following Bin's patch in
http://gcc.gnu.org/ml/gcc-patches/2013-09/msg00695.html, this patch
tweaks backtrace_base_for_ref () to strip of any widening conversion
after the first TREE_CODE check fails. Without this patch, the test
(gcc.dg/tree-ssa/slsr-39.c) in Bin's patch will fail on AArch64, as
backtrace_base_for_ref () will stop if not seeing an ssa_name since the
tree code can be nop_expr instead.
Regtested on arm and aarch64; still bootstrapping x86_64.
OK for the trunk if the x86_64 bootstrap succeeds?
Thanks,
Yufeng
gcc/
* gimple-ssa-strength-reduction.c (backtrace_base_for_ref): Call
get_unwidened and check 'base_in' again.diff --git a/gcc/gimple-ssa-strength-reduction.c
b/gcc/gimple-ssa-strength-reduction.c
index fea5741..7585164 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -769,7 +769,14 @@ backtrace_base_for_ref (tree *pbase)
STRIP_NOPS (base_in);
if (TREE_CODE (base_in) != SSA_NAME)
- return tree_to_double_int (integer_zero_node);
+ {
+ /* Strip of widening conversion(s) to handle cases where
+ e.g. 'B' is widened from an 'int' in order to calculate
+ a 64-bit address. */
+ base_in = get_unwidened (base_in, NULL_TREE);
+ if (TREE_CODE (base_in) != SSA_NAME)
+ return tree_to_double_int (integer_zero_node);
+ }
base_cand = base_cand_from_table (base_in);