This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Bug in simplify_if_then_else
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- Cc: jh at suse dot cz, gcc-patches at gcc dot gnu dot org
- Date: 17 Feb 2004 13:33:21 -0800
- Subject: Re: [PATCH] Bug in simplify_if_then_else
- References: <200402172047.VAA18922@faui1d.informatik.uni-erlangen.de>
Ulrich Weigand <weigand@i1.informatik.uni-erlangen.de> writes:
> Hello,
>
> on Jun 05, 2003, Jan Hubicka committed a patch to perform this
> optimization:
> * combine.c (simplify_if_then_else): (IF_THEN_ELSE (NE REG 0) (0) (8))
> is REG for nonzero_bits (REG) == 8.
>
> Unfortunately, this is invalid if the mode of the IF_THEN_ELSE
> is different from the mode of REG; this occurs in the test case
> attached below on s390-ibm-linux.
>
> The following patch simply refuses to do the optimization if
> the modes do not match (it might be possible to improve upon
> this by using subregs, but for now this patch fixes the bug
> without introducing new risks ...).
>
> Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux
> on both 3.4 and CVS head.
>
> OK for 3.4 and head?
This is OK.
--
- Geoffrey Keating <geoffk@geoffk.org>