Patch: Java: Fix jcf-write fold() fallout

Per Bothner per@bothner.com
Sat May 29 05:14:00 GMT 2004


Bryce McKinlay wrote:

> Does this look correct?

Looks plausible.

A comment would be nice.  Something like:

UNLT_EXPR(a, b) means 'a < b || unordered(a, b)'.  This is the same
as the Java source expression '!(a >= b)', so handle it that way.

> Index: jcf-write.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/java/jcf-write.c,v
> retrieving revision 1.145
> diff -u -r1.145 jcf-write.c
> --- jcf-write.c 28 May 2004 23:59:49 -0000      1.145
> +++ jcf-write.c 29 May 2004 00:52:01 -0000
> @@ -1179,25 +1179,25 @@
>       op = OPCODE_if_icmpne;
>       goto compare;
> 
> -    case UNLT_EXPR:
> +    case UNLE_EXPR:
>       unordered = 1;
>     case GT_EXPR:
>       op = OPCODE_if_icmpgt;
>       goto compare;
> 
> -    case UNGT_EXPR:
> +    case UNGE_EXPR:
>       unordered = 1;
>     case LT_EXPR:
>       op = OPCODE_if_icmplt;
>       goto compare;
> 
> -    case UNLE_EXPR:
> +    case UNLT_EXPR:
>       unordered = 1;
>     case GE_EXPR:
>       op = OPCODE_if_icmpge;
>       goto compare;
> 
> -    case UNGE_EXPR:
> +    case UNGT_EXPR:
>       unordered = 1;
>     case LE_EXPR:
>       op = OPCODE_if_icmple;
> 
> Bryce


-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/



More information about the Java-patches mailing list