c/7696: Spurious shift warning
Falk Hueffner
falk.hueffner@student.uni-tuebingen.de
Sun Apr 6 15:26:00 GMT 2003
The following reply was made to PR c/7696; it has been noted by GNATS.
From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
To: "Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de>
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" <ehrhardt@mathematik.uni-ulm.de> 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
More information about the Gcc-prs
mailing list