optimization/5244: Dead code in simplify_logical()
Kai.Tietz@onevision.de
Kai.Tietz@onevision.de
Tue Jan 29 05:36:00 GMT 2002
The following reply was made to PR optimization/5244; it has been noted by GNATS.
From: Kai.Tietz@onevision.de
To: Craig Rodrigues <rodrigc@mediaone.net>
Cc:
Subject: Re: optimization/5244: Dead code in simplify_logical()
Date: Tue, 29 Jan 2002 11:21:39 +0100
Hallo,
the reason for this patch is the elimination of dead code., because it will
be checked if GET_CODE(op1) is IOR or XOR and if so returned. But
it follows code which checks also for GET_CODE(op1) is XOR, what will be
never reached.
if (GET_CODE (op1) == IOR || GET_CODE (op1) == XOR)
return apply_distributive_law
(gen_binary (GET_CODE (op1), mode,
gen_binary (AND, mode, XEXP (op1, 0), op0),
gen_binary (AND, mode, XEXP (op1, 1),
copy_rtx (op0))));
/* Similarly, taking advantage of the fact that
(and (not A) (xor B C)) == (xor (ior A B) (ior A C)) */
if (GET_CODE (op0) == NOT && GET_CODE (op1) == XOR /* Condition is
always false, see above */)
return apply_distributive_law
(gen_binary (XOR, mode,
gen_binary (IOR, mode, XEXP (op0, 0), XEXP (op1, 0)),
gen_binary (IOR, mode, copy_rtx (XEXP (op0, 0)),
XEXP (op1, 1))));
else if (GET_CODE (op1) == NOT && GET_CODE (op0) == XOR /* Condition
is always false, see above */)
return apply_distributive_law
(gen_binary (XOR, mode,
gen_binary (IOR, mode, XEXP (op1, 0), XEXP (op0, 0)),
gen_binary (IOR, mode, copy_rtx (XEXP (op1, 0)), XEXP
(op0, 1))));
break;
case IOR:
I hope this helps
Cheers
More information about the Gcc-prs
mailing list