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]

Re: Unused case statements in expand_expr



>    In message <199806231544.QAA07673@nick.btinternet.com>you write:
>    > 
>    > In `expand_expr' we have:
>    > 
>    >     case FIX_ROUND_EXPR:
>    >     case FIX_FLOOR_EXPR:
>    >     case FIX_CEIL_EXPR:
>    >       abort ();			/* Not used for C.  */
>    > 
>    > 
>    > Since expr.c is `supposed' to be language-independent then can I remove
>    > these case statements ? The end result is that `abort' will be called anyway.
>    > It also means that languages that wish to implement any of those codes
>    > can provide them in a language specific hook through the default case
>    > `lang_expand_expr'.
>
>  But if they're useful for more than one language, then you have to
>  duplicate code.
>
>  Seems to me that if you've had to implement support for these nodes
>  that we can/should just drop your implementation into expand_expr.

OK. I'm convinced now. :-)

I am going to have to take the plunge and implement FIX_ROUND_EXPR,
FIX_FLOOR_EXPR and FIX_CEIL_EXPR. A quick look shows a fair amount of work
to be done, such as adding rounding-mode support to config/fp-bit.c and
hacking optabs.c to support the IEEE rounding modes, so don't expect anything
too soon.

Nick.



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