aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2016-05-25 20:41:01 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2016-05-25 20:41:01 +0000
commita88a7b22c9d0df1068bdc92522ea805d0edf676f (patch)
tree793a264e2566b1ca06cd1bc77b31678385a44bf6 /gcc/tree-ssa-phiopt.c
parent125f02edbd9384baf312f2bb0bbbcf435a65cd18 (diff)
downloadgcc-a88a7b22c9d0df1068bdc92522ea805d0edf676f.zip
gcc-a88a7b22c9d0df1068bdc92522ea805d0edf676f.tar.gz
gcc-a88a7b22c9d0df1068bdc92522ea805d0edf676f.tar.bz2
tree-ssa-phiopt.c (factor_out_conditional_conversion): Remove redundant test and bail out if the type of the new operand is not a...
* tree-ssa-phiopt.c (factor_out_conditional_conversion): Remove redundant test and bail out if the type of the new operand is not a GIMPLE register type after stripping a VIEW_CONVERT_EXPR. From-SVN: r236748
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
-rw-r--r--gcc/tree-ssa-phiopt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index a752fe0..caf591b 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -438,15 +438,18 @@ factor_out_conditional_conversion (edge e0, edge e1, gphi *phi,
/* Check if arg0 is an SSA_NAME and the stmt which defines arg0 is
a conversion. */
arg0_def_stmt = SSA_NAME_DEF_STMT (arg0);
- if (!is_gimple_assign (arg0_def_stmt)
- || !gimple_assign_cast_p (arg0_def_stmt))
+ if (!gimple_assign_cast_p (arg0_def_stmt))
return NULL;
/* Use the RHS as new_arg0. */
convert_code = gimple_assign_rhs_code (arg0_def_stmt);
new_arg0 = gimple_assign_rhs1 (arg0_def_stmt);
if (convert_code == VIEW_CONVERT_EXPR)
- new_arg0 = TREE_OPERAND (new_arg0, 0);
+ {
+ new_arg0 = TREE_OPERAND (new_arg0, 0);
+ if (!is_gimple_reg_type (TREE_TYPE (new_arg0)))
+ return NULL;
+ }
if (TREE_CODE (arg1) == SSA_NAME)
{