This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: calculate CDI_DOMINATORS in tree-ssa-sink
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Josh Conner <jconner at apple dot com>
- Date: Thu, 4 Jan 2007 00:24:50 +0100
- Subject: Re: PATCH: calculate CDI_DOMINATORS in tree-ssa-sink
- References: <459AF8EE.2060105@apple.com>
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