summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorglisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-16 10:26:51 +0000
committerglisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-16 10:26:51 +0000
commitea1b629e1679f508df9743680ac0eb3985ef48b5 (patch)
tree9493047601849c95b5770ec075bca0b02745c32d /gcc/fold-const.c
parentd70b714028b62982297ee5ebf8bfe6a572dc7fa3 (diff)
downloadgcc-ea1b629e1679f508df9743680ac0eb3985ef48b5.tar.gz
2013-05-16 Marc Glisse <marc.glisse@inria.fr>
PR middle-end/57286 gcc/ * fold-const.c (fold_ternary_loc) <VEC_COND_EXPR>: Disable some transformations to avoid an infinite loop. gcc/testsuite/ * gcc.dg/pr57286.c: New testcase. * gcc.dg/vector-shift-2.c: Don't assume int has size 4. * g++.dg/ext/vector22.C: Comment out transformations not performed anymore. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198964 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index e02f0c60d9a..97b5216eb71 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -14211,6 +14211,12 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type,
fold_convert_loc (loc, type,
TREE_OPERAND (arg0, 0)));
+ /* Disable the transformations below for vectors, since
+ fold_binary_op_with_conditional_arg may undo them immediately,
+ yielding an infinite loop. */
+ if (code == VEC_COND_EXPR)
+ return NULL_TREE;
+
/* Convert A ? B : 0 into A && B if A and B are truth values. */
if (integer_zerop (op2)
&& truth_value_p (TREE_CODE (arg0))