]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-eh.c (cleanup_empty_eh): Allow a call to __builtin_stack_restore if there is...
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 25 Sep 2011 14:55:12 +0000 (14:55 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 25 Sep 2011 14:55:12 +0000 (14:55 +0000)
* tree-eh.c (cleanup_empty_eh): Allow a call to __builtin_stack_restore
if there is no outgoing edge.

* tree-scalar-evolution.c (simple_iv): Accept all kinds of pointer and
integral types.

From-SVN: r179165

gcc/ChangeLog
gcc/tree-eh.c
gcc/tree-scalar-evolution.c

index 6978fab421f79e6151cb3521a6d8120d0909c30d..2ad1aeffcce36e9ebdb646dd688cec14c9e8fda3 100644 (file)
@@ -1,3 +1,11 @@
+2011-09-25  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * tree-eh.c (cleanup_empty_eh): Allow a call to __builtin_stack_restore
+       if there is no outgoing edge.
+
+       * tree-scalar-evolution.c (simple_iv): Accept all kinds of pointer and
+       integral types.
+
 2011-09-25  Ira Rosen  <ira.rosen@linaro.org>
 
        * tree-vect-slp.c (vect_slp_analyze_bb_1): Split out core part
index f10d72d1d68ae5fb73de5b6322296af840a2dce8..3a582678f33885c8d9f61c5d188d1e742f7fcd00 100644 (file)
@@ -3863,8 +3863,15 @@ cleanup_empty_eh (eh_landing_pad lp)
       return cleanup_empty_eh_unsplit (bb, e_out, lp);
     }
 
-  /* The block should consist only of a single RESX statement.  */
+  /* The block should consist only of a single RESX statement, modulo a
+     preceding call to __builtin_stack_restore if there is no outgoing
+     edge, since the call can be eliminated in this case.  */
   resx = gsi_stmt (gsi);
+  if (!e_out && gimple_call_builtin_p (resx, BUILT_IN_STACK_RESTORE))
+    {
+      gsi_next (&gsi);
+      resx = gsi_stmt (gsi);
+    }
   if (!is_gimple_resx (resx))
     return false;
   gcc_assert (gsi_one_before_end_p (gsi));
index 6c32923852e8df84888b33eca2b4bcff27634e83..2077c8dc9f3dc1dda0fed0b927b64cb400ee7be6 100644 (file)
@@ -3172,8 +3172,8 @@ simple_iv (struct loop *wrto_loop, struct loop *use_loop, tree op,
   iv->no_overflow = false;
 
   type = TREE_TYPE (op);
-  if (TREE_CODE (type) != INTEGER_TYPE
-      && TREE_CODE (type) != POINTER_TYPE)
+  if (!POINTER_TYPE_P (type)
+      && !INTEGRAL_TYPE_P (type))
     return false;
 
   ev = analyze_scalar_evolution_in_loop (wrto_loop, use_loop, op,