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: New Jacks Regressions: Constant Folding of Casts


On Wed, 21 Jul 2004, Ranjit Mathew wrote:
> No, "case (int )Float.NaN:" also doesn't work.
>
> The Java front end does call fold() on case nodes.
> Has this become invalid now?


Thanks.  The bug is in java/typeck.c's convert_ieee_real_to_integer.
This routine builds the COND_EXPRs and relational tests that implement
java's semantics of truncating out-of-range floating point values to
zero.

Unfortunately, none of the six calls to build2/build3 are immediately
followed by a call to "fold".  I suspect that unrelated changes have
exposed this latent problem, as the code in convert_ieee_real_to_integer
has failed to call fold since atleast gcc 3.2.

I'll prepare and test a patch, unless someone beats me to it.

Roger
--


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