This is the mail archive of the gcc-patches@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]

[tree-ssa] fix gcc.c-torture/execute/20030330-1.c


        * builtins.c (simplify_builtin): Handle BUILT_IN_CONSTANT_P.

Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.152.2.37
diff -u -p -r1.152.2.37 builtins.c
--- builtins.c	12 Oct 2003 19:43:31 -0000	1.152.2.37
+++ builtins.c	18 Oct 2003 20:22:37 -0000
@@ -6705,6 +6705,14 @@ simplify_builtin (tree exp, int ignore)
     case BUILT_IN_SPRINTF:
       val = simplify_builtin_sprintf (arglist, ignore);
       break;
+    case BUILT_IN_CONSTANT_P:
+      val = fold_builtin_constant_p (arglist);
+      /* Gimplification will pull the CALL_EXPR for the builtin out of
+	 an if condition.  When not optimizing, we'll not CSE it back.
+	 To avoid link error types of regressions, return false now.  */
+      if (!val && !optimize)
+	val = integer_zero_node;
+      break;
     default:
       val = NULL_TREE;
       break;


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