From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Modra To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: c/4214: powerpc64: wrong code from optimized mask and shift Date: Mon, 03 Sep 2001 19:26:00 -0000 Message-id: <20010904022602.27235.qmail@sourceware.cygnus.com> X-SW-Source: 2001-09/msg00049.html List-Id: The following reply was made to PR c/4214; it has been noted by GNATS. From: Alan Modra To: Kevin Ryde , mark@codesourcery.com Cc: gcc-gnats@gcc.gnu.org, David Edelsohn Subject: Re: c/4214: powerpc64: wrong code from optimized mask and shift Date: Tue, 4 Sep 2001 11:51:06 +0930 On Tue, Sep 04, 2001 at 09:39:45AM +1000, Kevin Ryde wrote: > > A certain mask and shift combination produces a wrong answer when > compiled with optimization. > > >How-To-Repeat: > A program foo.c, > > int n = 3; > > int > main (void) > { > printf ("%d\n", (n & 2) << 1); > return 0; > } Fixed by http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01493.html , which I applied to mainline. Is the patch OK for the branch Mark? You could argue that it contains optimisations (extra patterns for rldicr, no bit-shifting loops) as well as the bugfix for rldic, but I'm far more likely to make an error if I try to split the patch rather than apply the lot. ;-) Alan