From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9811 invoked by alias); 6 Apr 2003 15:26:00 -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 9797 invoked by uid 71); 6 Apr 2003 15:26:00 -0000 Date: Sun, 06 Apr 2003 15:26:00 -0000 Message-ID: <20030406152600.9796.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Falk Hueffner Subject: Re: c/7696: Spurious shift warning Reply-To: Falk Hueffner X-SW-Source: 2003-04/txt/msg00197.txt.bz2 List-Id: The following reply was made to PR c/7696; it has been noted by GNATS. From: Falk Hueffner To: "Christian Ehrhardt" Cc: gcc-gnats@gcc.gnu.org, schwab@suse.de, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org Subject: Re: c/7696: Spurious shift warning Date: 06 Apr 2003 16:50:37 +0200 "Christian Ehrhardt" writes: > struct ia64_psr { > unsigned long cpl : 2; > } x = {1}; > > unsigned long y = ((unsigned long) x.cpl) << 40; > > According to gdb the cast is thrown away early (build_binary_op > doesn't see it at all), probably because the bitfield is of type > unsigned long. All casts of bit-fields to the same type get discarded. This is a very long standing bug and has already been reported as c/3325, c/3326, c/6346, c/6515 and target/9620. We also have xfailing gcc.c-torture/execute/bitfld-1.c for it. -- Falk