cse.c (rest_of_handle_cse): Use cleanup_cfg returned value cse_cfg_altered computation.
authorIlya Enkovich <ilya.enkovich@intel.com>
Fri, 13 May 2016 09:55:58 +0000 (09:55 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Fri, 13 May 2016 09:55:58 +0000 (09:55 +0000)
gcc/

* cse.c (rest_of_handle_cse): Use cleanup_cfg
returned value cse_cfg_altered computation.
(rest_of_handle_cse2): Likewise.
(rest_of_handle_cse_after_global_opts): Likewise.

gcc/testsuite/

* gcc.dg/pr71084.c: New test.

From-SVN: r236199

gcc/ChangeLog
gcc/cse.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr71084.c [new file with mode: 0644]

index 27deda6cc1423b233c05a28641754402685fb59e..0346cbc9ee1c83436a6bb1aa1b3ff4803487dd42 100644 (file)
@@ -1,3 +1,10 @@
+2016-05-13  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       * cse.c (rest_of_handle_cse): Use cleanup_cfg
+       returned value cse_cfg_altered computation.
+       (rest_of_handle_cse2): Likewise.
+       (rest_of_handle_cse_after_global_opts): Likewise.
+
 2016-05-13  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
 
         PR target/53440
index 04e1a8563d7d2daca7773047808cb5809b95ef1c..322e35270d816d695871df07e023525078b0f7ab 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -7562,11 +7562,11 @@ rest_of_handle_cse (void)
     {
       timevar_push (TV_JUMP);
       rebuild_jump_labels (get_insns ());
-      cleanup_cfg (CLEANUP_CFG_CHANGED);
+      cse_cfg_altered |= cleanup_cfg (CLEANUP_CFG_CHANGED);
       timevar_pop (TV_JUMP);
     }
   else if (tem == 1 || optimize > 1)
-    cleanup_cfg (0);
+    cse_cfg_altered |= cleanup_cfg (0);
 
   if (cse_cfg_altered && dom_info_available_p (CDI_DOMINATORS))
     free_dominance_info (CDI_DOMINATORS);
@@ -7634,11 +7634,11 @@ rest_of_handle_cse2 (void)
     {
       timevar_push (TV_JUMP);
       rebuild_jump_labels (get_insns ());
-      cleanup_cfg (CLEANUP_CFG_CHANGED);
+      cse_cfg_altered |= cleanup_cfg (CLEANUP_CFG_CHANGED);
       timevar_pop (TV_JUMP);
     }
   else if (tem == 1)
-    cleanup_cfg (0);
+    cse_cfg_altered |= cleanup_cfg (0);
 
   if (cse_cfg_altered && dom_info_available_p (CDI_DOMINATORS))
     free_dominance_info (CDI_DOMINATORS);
@@ -7711,11 +7711,11 @@ rest_of_handle_cse_after_global_opts (void)
     {
       timevar_push (TV_JUMP);
       rebuild_jump_labels (get_insns ());
-      cleanup_cfg (CLEANUP_CFG_CHANGED);
+      cse_cfg_altered |= cleanup_cfg (CLEANUP_CFG_CHANGED);
       timevar_pop (TV_JUMP);
     }
   else if (tem == 1)
-    cleanup_cfg (0);
+    cse_cfg_altered |= cleanup_cfg (0);
 
   if (cse_cfg_altered && dom_info_available_p (CDI_DOMINATORS))
     free_dominance_info (CDI_DOMINATORS);
index e3b0280a35d9b8622b57e1a6700c5a2a56b41da0..4547ce31916b4a9c6161b035f906944946ef4b45 100644 (file)
@@ -1,3 +1,7 @@
+2016-05-13  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       * gcc.dg/pr71084.c: New test.
+
 2016-05-13  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
 
         PR target/53440
diff --git a/gcc/testsuite/gcc.dg/pr71084.c b/gcc/testsuite/gcc.dg/pr71084.c
new file mode 100644 (file)
index 0000000..46fdf9f
--- /dev/null
@@ -0,0 +1,38 @@
+/* PR tree-optimization/71084 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void babl_format (void);
+void gimp_drawable_get_format (void);
+int _setjmp (void);
+
+enum {
+  GIMP_RGB_IMAGE,
+  GIMP_RGBA_IMAGE,
+  GIMP_GRAY_IMAGE,
+  GIMP_GRAYA_IMAGE,
+  GIMP_INDEXED_IMAGE
+} run_i;
+
+int run_height;
+
+void fn1 ()
+{
+  int type, width;
+  if (_setjmp ())
+    switch (type)
+      {
+      case GIMP_RGB_IMAGE:
+       babl_format ();
+      case GIMP_RGBA_IMAGE:
+      case GIMP_GRAY_IMAGE:
+       babl_format ();
+      case GIMP_GRAYA_IMAGE:
+      case GIMP_INDEXED_IMAGE:
+       gimp_drawable_get_format();
+      }
+  for (; run_height;)
+    for (; run_i < (long)fn1; ++run_i)
+      for (; width;)
+        ;
+}