From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6234 invoked by alias); 12 Jul 2002 17:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 6219 invoked by uid 71); 12 Jul 2002 17:06:01 -0000 Date: Fri, 12 Jul 2002 10:06:00 -0000 Message-ID: <20020712170601.6218.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Falk Hueffner Subject: Re: c/7284: incorrectly simplifies leftshift followed by signed power-of-2 division Reply-To: Falk Hueffner X-SW-Source: 2002-07/txt/msg00383.txt.bz2 List-Id: The following reply was made to PR c/7284; it has been noted by GNATS. From: Falk Hueffner To: "Al Grant" Cc: nathan@gcc.gnu.org, algrant@acm.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c/7284: incorrectly simplifies leftshift followed by signed power-of-2 division Date: 12 Jul 2002 19:01:43 +0200 "Al Grant" writes: > 3.3.7 (something else in ISO, maybe 6.3.7) > > The result of E1 << E2 is E1 left-shifted E2 bit > positions; vacated bits are filled with zeros. > > For signed types it says nothing more. > > Now if signed left-shift is defined at all, in terms of the > representation, I don't see there's any lack of definition in > "0x00000080 left-shifted 24 bit positions", it is clearly 0x80000000 > (of the same type). So it's defined unless the standard says > otherwise, which only C99 seems to. Defect Report #081 seems to be of interest here (http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/dr_081.html). It basically states that the behaviour is implementation defined (for any signed left shift, not just this case). -- Falk