This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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 Jul 20, 2004, at 12:30 AM, Ranjit Mathew wrote:


Hi,

In the last 24 hours, the following:

case ((int )Float.NaN == 0 ? 1 : 0): break;

now gives an error saying "Constant expression required".
This causes 4 new Jacks failures. (Note that casting NaN
to an int should give the value 0.)

I note that something like "0 == 0 ? 1 : 0" does not
give this error.

I am not able to quickly tell what could be causing
this failure.

Any insights?

Maybe this change has something to do with it: 2004-07-19 Roger Sayle <roger@eyesopen.com>

        * fold-const.c (tree_expr_nonzero_p): Add function prototype.
        (fold) <EQ_EXPR>: Move tree_expr_nonzero_p optimization from
        fold_relational_const to here, i.e. "(x | 5) == 0" -> false.
        (fold) (UNEQ_EXPR>: Add optimizations for unordered comparisons
        of the form "x op x" where op is UNLE, UNGE, UNEQ or LTGT.
        (fold_relational_const): Tidy up handling of floating point
        comparisons by calling real_compare.  Remove tree_expr_nonzero_p
        transformation; fold_relational_const assumes constant operands.

Since that is the only change fold not to fold something.

Thanks,
Andrew Pinski


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