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

[PATCH] Kill TREE_OVERFLOW during gimplification


Related to the last patch, I don't think there is any point keeping
TREE_OVERFLOW integers in GIMPLE, so this patch removes the overflow
flags during gimplification.  As TREE_OVERFLOW happens to be an optimization
barrier in many cases, this helps getting rid of missed optimizations.
Still, any folding during gimple passes that doesn't go through gimplifier
on the result may introduce again TREE_OVERFLOW constants, but this at least
decreases their number.  Bootstrapped/regtested on x86_64-linux, during
make check this triggered 1355 times.

Any objections?

2008-10-16  Jakub Jelinek  <>

	* gimplify.c (gimplify_expr): Drop TREE_OVERFLOW from

--- gcc/gimplify.c.jj	2008-10-07 16:17:02.000000000 +0200
+++ gcc/gimplify.c	2008-10-16 09:13:46.000000000 +0200
@@ -6441,6 +6441,16 @@ gimplify_expr (tree *expr_p, gimple_seq 
 	  /* Constants need not be gimplified.  */
+	  /* Don't preserve TREE_OVERFLOW flags, it only inhibits
+	     many optimizations and FEs should have taken care of
+	     reporting all the required diagnostics.  */
+	  if (TREE_OVERFLOW (*expr_p))
+	    *expr_p = build_int_cst_wide (TREE_TYPE (*expr_p),
+					  TREE_INT_CST_LOW (*expr_p),
+					  TREE_INT_CST_HIGH (*expr_p));
+	  ret = GS_ALL_DONE;
+	  break;
 	case REAL_CST:
 	case FIXED_CST:
 	case STRING_CST:


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