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] 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 <iant@google.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
> {
>   CDI_DOMINATORS,
>   CDI_POST_DOMINATORS
> };
> 
> 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.

jeff



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