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: calculate CDI_DOMINATORS in tree-ssa-sink


On Wednesday 03 January 2007 01:29, Josh Conner wrote:
> All -
>
> There's a relatively obvious fix that should be made in
> execute_sink_code.  This statement:
>
>   calculate_dominance_info (CDI_DOMINATORS | CDI_POST_DOMINATORS);
>
> assuming it is intended to calculate both dominators and
> post-dominators, is incorrect.  Since CDI_*DOMINATORS are enums and not
> bitfields (CDI_DOMINATORS==0 and CDI_POST_DOMINATORS==1), we're only
> calculating post-dom info.

This is not the first time that this bug had to be fixed in some
pass.  You get to score Mega Bonus Points if you can fix the
problem at the root:

Index: basic-block.h
===================================================================
--- basic-block.h       (revision 120352)
+++ basic-block.h       (working copy)
@@ -935,8 +935,8 @@ extern void reorder_basic_blocks (unsign

 enum cdi_direction
 {
-  CDI_DOMINATORS,
-  CDI_POST_DOMINATORS
+  CDI_DOMINATORS = 1,
+  CDI_POST_DOMINATORS = 2
 };

 enum dom_state

...and a larger number of fixes in dominance.c everywhere where
we look at dom_computed[].

Gr.
Steven


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