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: [gfortran] Minor cleanup to trans-intrinsic.c


> > 2004-12-20 ?Tobias Schlueter ?<tobias.schlueter@physik.uni-muenchen.de>
> > 
> > ??????* trans-intrinsic.c (build_fix_expr): Change 'op' argument
> > ??????to correct enum type.
> > ??????(gfc_conv_intrinsic_aint): Likewise. ?Also correct comment in
> > ??????front of function. ?Add default case to switch.
<...>
> > + ? ?default: 
> > + ? ? ?gcc_unreachable ();
> > ? ? ?}
> > 
> > ? ?/* Evaluate the argument. ?*/
> 
> Because the switch deals with FIX_ROUND_EXPR and FIX_FLOOR_EXPR, but the
> function is called with FIX_ROUND_EXPR and FIX_TRUNC_EXPR, which I had
> originally misread.
>
> Would this patch be ok if I added
>    case FIX_TRUNC_EXPR:
>       break;
> to the switch?

No. I think this is a latent bug.
I suggest add the gcc_unreachable, and do s/FLOOR/TRUNC/

Paul


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