This is the mail archive of the
mailing list for the GCC project.
Re: [Committed] PR rtl-optimization/29797: ifcvt.c vs BITS_BIG_ENDIAN
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Roger Sayle" <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 13 Nov 2006 11:04:15 +0100
- Subject: Re: [Committed] PR rtl-optimization/29797: ifcvt.c vs BITS_BIG_ENDIAN
- References: <Pine.LNX.email@example.com>
On 11/13/06, Roger Sayle <firstname.lastname@example.org> wrote:
The following patch is a very slightly modified version Michael Matz's
fix for the wrong-code regression. My patch to implement PR9814 didn't
take into account the influence of BITS_BIG_ENDIAN on the semantics of
zero_extract. Indeed, this can be confirmed by noticing that the added
gcc.dg/pr9814-1.c testcase isn't being optimized on powerpc and other
BITS_BIG_ENDIAN targets. Adding the appropriate logic to correct for
BITS_BIG_ENDIAN corrects, this and addresses the miscompilation bug.
int test1(int x)
if (x & 2)
x |= 2;
On powerpc-unknown-linux-gnu previously generated:
test1: andi. 0,3,2
and with the correction below we now generate:
This patch has been tested against mainline on powerpc-unknown-linux-gnu
with a full "make bootstrap", all default languages, and regression tested
with a top-level "make -k check" with no new failures. Andrew Pinski has
also tested a similar patch on powerpc-darwin without problems. However,
Richard Guenther has reported problems on ppc64 on the 4.1 branch. I
suspect this might be a bad interaction with an independent latent bug on
older branches, or a 64-bit issue perhaps addressed by the variant of
this patch below. To avoid problems, I'll fully test against the 4.1 and
4.2 branches on both ppc and ppc64 before backporting.
It turns out this was a mistake on my side where I used GET_MODE_BITSIZE
before extracting the mode...
So, sorry for the confusion.