This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Sep 2005 14:53:45 -0000
- Subject: [Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x
- References: <20050724142245.23049.drab@kepler.fjfi.cvut.cz>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-17 14:53 -------
Here is the patch:
Index: fold-const.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.625
diff -u -p -r1.625 fold-const.c
--- fold-const.c 9 Sep 2005 09:00:33 -0000 1.625
+++ fold-const.c 17 Sep 2005 14:53:00 -0000
@@ -9953,6 +9953,8 @@ fold_ternary (enum tree_code code, tree
return NULL_TREE;
case COND_EXPR:
+ /* Fold the condition operand, just in case it needs to be foldded. */
+ arg0 = fold (arg0);
/* Pedantic ANSI C says that a conditional expression is never an lvalue,
so all simple results must be passed through pedantic_non_lvalue. */
if (TREE_CODE (arg0) == INTEGER_CST)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23049