This is the mail archive of the gcc@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: switch question in recog.c


On Tue, 2003-10-07 at 14:59, Daniel Jacobowitz wrote:
> On Tue, Oct 07, 2003 at 02:54:40PM -0400, Andrew MacLeod wrote:

> >         default:
> >           /* For all other letters, we first check for a register class,
> >              otherwise it is an EXTRA_CONSTRAINT.  */
> >           if (REG_CLASS_FROM_CONSTRAINT (c, constraint) != NO_REGS)
> >             {
> >             case 'r':
> >               if (GET_MODE (op) == BLKmode)
> >                 break;
> >               if (register_operand (op, VOIDmode))
> >                 result = 1;
> >             }
> > #ifdef EXTRA_CONSTRAINT_STR
> >           if (EXTRA_CONSTRAINT_STR (op, c, constraint))
> >             result = 1;
> >           if (EXTRA_MEMORY_CONSTRAINT (c, constraint))
> > <...>
> > 
> > Look at where the case 'r' is.. its inside the 'default:' case. Is that
> > really kosher?
> 
> Yep.  It acts basically as a label, they're only scoped by additional
> switch statements.  At least that's my reading of the standard.
> 
Huh. I would have failed that question miserably after using the
language for 20 years. It would never occur to me to put a case after
the default label, let alone inside a control structure of some sort.
How miserable :-) But you are right, the standard doesnt appear to
disallow it that I can see.

Thanks
Andrew


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