This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] PR/28218, thinko in tree-ssa-math-opts.c
On Wed, 2006-07-05 at 20:25 +0200, Steven Bosscher wrote:
> On 05 Jul 2006 09:43:47 -0700, Ian Lance Taylor <email@example.com> wrote:
> > > --- dominance.c (revision 115112)
> > > +++ dominance.c (working copy)
> > > @@ -614,6 +614,8 @@ calculate_dominance_info (enum cdi_direc
> > > struct dom_info di;
> > > basic_block b;
> > >
> > > + gcc_assert (dir == CDI_DOMINATORS || dir == CDI_POST_DOMINATORS);
> > > +
> > > if (dom_computed[dir] == DOM_OK)
> > > return;
> > This patch is OK (if tested, with ChangeLog entry, etc.)
> After hitting send, I looked at the definition of enum cdi_direction:
> enum cdi_direction
> So CDI_DOMINATORS | CDI_POST_DOMINATORS == CDI_POST_DOMINATORS
> which means that my patch wouldn't catch anything.
Almost makes you wonder if GCC could have an optional warning for
bit operations on enums. While they're sometimes useful, I suspect
they're erroneous more often than not.