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
> On Thu, 2007-01-04 at 00:24 +0100, Steven Bosscher wrote:
> > 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:
> Or add a new warning for applying bitwise operations on enums...
> Most of the time that's going to be a mistake...
>
> Twiddling the enum values really isn't the answer.
You will get warnings on e. g. bb_flags enum in basic-block.h that does
precisely what Steven suggest. It is a way to make the names
available in debugger and seems pretty sensible practice to me.
Honza
>
> jeff