From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21066 invoked by alias); 1 Dec 2005 11:01:33 -0000 Received: (qmail 21049 invoked by uid 48); 1 Dec 2005 11:01:31 -0000 Date: Thu, 01 Dec 2005 11:01:00 -0000 Message-ID: <20051201110131.21048.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/25186] (short)(((int)short_var) <<1) should be folded so that the shift is done in the short type In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2005-12/txt/msg00042.txt.bz2 List-Id: ------- Comment #3 from rguenth at gcc dot gnu dot org 2005-12-01 11:01 ------- Doh. The C frontend _does_ the promotion (in the unsigned case): (intD.0) *aD.1296 << 1 just convert.c:convert_to_integer "folds" it to a shift on unsigned short again. This transformation should be moved to fold instead. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25186