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]

Re: [PATCH] Don't bypass blocks with multiple latch edges (PR middle-end/54838)


On Wed, Nov 28, 2012 at 10:52:17AM +0100, Eric Botcazou wrote:
> No, I don't think that's the problem.  The above messages are admittedly a bit 
> terse, they should say:
> 
> JUMP-BYPASS: Proved reg 59 in jump_insn 15 equals constant (const_int 3 [0x3])
>              when BB 4 is entered from BB 9.  Redirect edge 9->4 to 5.
> 
> so you can have different constants for BB 3 and BB 9.  The patch to tweak the 
> dump messages along these lines is pre-approved.

Ouch.  Okay, I'll post a separate patch for improving the message.

> The ICE in merge_latch_edges means that the loop structure and the CFG aren't 
> in sync anymore.  Does the cprop pass modify the former without declaring it?

I admit I'm not sure what to look at, maybe cprop should have in
properties_destroyed PROP_loops?  Well, then we need to remove one
assert in loop-init.c.  So something like:

--- gcc/cprop.c.mp	2012-11-28 16:55:03.520375191 +0100
+++ gcc/cprop.c	2012-11-28 16:55:35.992246623 +0100
@@ -1927,7 +1927,7 @@ struct rtl_opt_pass pass_rtl_cprop =
   TV_CPROP,                             /* tv_id */
   PROP_cfglayout,                       /* properties_required */
   0,                                    /* properties_provided */
-  0,                                    /* properties_destroyed */
+  PROP_loops,                           /* properties_destroyed */
   0,                                    /* todo_flags_start */
   TODO_df_finish | TODO_verify_rtl_sharing |
   TODO_verify_flow | TODO_ggc_collect   /* todo_flags_finish */
--- gcc/loop-init.c.mp	2012-11-28 16:55:08.924398879 +0100
+++ gcc/loop-init.c	2012-11-28 16:55:17.684437276 +0100
@@ -54,8 +54,6 @@ loop_optimizer_init (unsigned flags)
     }
   else
     {
-      gcc_assert (cfun->curr_properties & PROP_loops);
-
       /* Ensure that the dominators are computed, like flow_loops_find does.  */
       calculate_dominance_info (CDI_DOMINATORS);
 
This quashes the ICE.  I've regtested it, it caused one
regression though:
FAIL: gcc.dg/unroll_5.c scan-rtl-dump-times loop2_unroll "realistic
bound: 2999999" 1

But there probably is something else.

Thanks for the review,

	Marek


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