>From: Andi Kleen <ak@xxxxxx>
>
>This patch removes an incorrect simplification: !!x is not x in C.
It is valid if you know x is 0 or 1. This will be the case if x
is a relational operator or of boolean type (MTYPE_B).
If the simplification doesn't check for this, then I agree it's wrong.
We'll have to take a closer look.
Do you have a test case or some bug which this caused trouble with?
Thank,
Ken
>-Andi
>
>--- osprey1.0/common/com/wn_simp_code.h-o Mon Mar 12 23:28:23 2001
>+++ osprey1.0/common/com/wn_simp_code.h Sun May 13 00:50:36 2001
>@@ -1118,7 +1118,6 @@
> /*------------------------------------------------
> Simplifications for ~ and !:
>
>- ! ! j j
> ~ ~ j j
> ! <comp> inverse comp, IEEE_comparisons false for
> floating point
> ~(a | b) a nor b
>@@ -1133,7 +1132,7 @@
> simpnode r = NULL;
> OPCODE inverse_relop;
>
>- if (opc == SIMPNODE_opcode(k0)) {
>+ if (opc != OPR_LNOT && opc == SIMPNODE_opcode(k0)) {
> SHOW_RULE("~ ~ j -> j");
> r = SIMPNODE_kid0(k0);
> SIMP_DELETE(k0);
>
>
>
>
>--
>Life would be so much easier if we could just look at the source code.
>
|