This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/23049] [4.1 Regression] ICE with -O3 -ftree-vectorize on 4.1.x


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]