aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-09-23 12:37:22 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-09-23 12:37:22 +0000
commit26bedff5fdfaf69b1e1d4a597e4a505d0d3dac87 (patch)
treee44887ed888b8fbc2b15f0e734fb161f867a92db
parent643e08545f850c9fcfc42f4411da834e857905fd (diff)
downloadgcc-26bedff5fdfaf69b1e1d4a597e4a505d0d3dac87.zip
gcc-26bedff5fdfaf69b1e1d4a597e4a505d0d3dac87.tar.gz
gcc-26bedff5fdfaf69b1e1d4a597e4a505d0d3dac87.tar.bz2
re PR tree-optimization/77697 (suspicious code in tree-ssa-forwprop.c)
2016-09-23 Richard Biener <rguenther@suse.de> PR tree-optimization/77697 * tree-ssa-forwprop.c (defcodefor_name): Remove bogus code, signal error if we have sth ternary or unhandled. From-SVN: r240430
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-forwprop.c13
2 files changed, 12 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3bc2c82..2c4cf43 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-09-23 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/77697
+ * tree-ssa-forwprop.c (defcodefor_name): Remove bogus code,
+ signal error if we have sth ternary or unhandled.
+
2016-09-23 Matthew Wahab <matthew.wahab@arm.com>
* config/arm/arm_neon.h (vabd_f16): New.
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 5d7739b..9cf2768 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -1458,6 +1458,7 @@ defcodefor_name (tree name, enum tree_code *code, tree *arg1, tree *arg2)
code1 = TREE_CODE (name);
arg11 = name;
arg21 = NULL_TREE;
+ arg31 = NULL_TREE;
grhs_class = get_gimple_rhs_class (code1);
if (code1 == SSA_NAME)
@@ -1470,20 +1471,18 @@ defcodefor_name (tree name, enum tree_code *code, tree *arg1, tree *arg2)
code1 = gimple_assign_rhs_code (def);
arg11 = gimple_assign_rhs1 (def);
arg21 = gimple_assign_rhs2 (def);
- arg31 = gimple_assign_rhs2 (def);
+ arg31 = gimple_assign_rhs3 (def);
}
}
- else if (grhs_class == GIMPLE_TERNARY_RHS
- || GIMPLE_BINARY_RHS
- || GIMPLE_UNARY_RHS
- || GIMPLE_SINGLE_RHS)
- extract_ops_from_tree (name, &code1, &arg11, &arg21, &arg31);
+ else if (grhs_class != GIMPLE_SINGLE_RHS)
+ code1 = ERROR_MARK;
*code = code1;
*arg1 = arg11;
if (arg2)
*arg2 = arg21;
- /* Ignore arg3 currently. */
+ if (arg31)
+ *code = ERROR_MARK;
}