From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 540 invoked by alias); 6 Nov 2007 12:37:44 -0000 Received: (qmail 500 invoked by uid 48); 6 Nov 2007 12:37:32 -0000 Date: Tue, 06 Nov 2007 12:37:00 -0000 Message-ID: <20071106123732.499.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/33970] Missed optimization using unsigned char loop variable In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "henning dot m at insightbb dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg00466.txt.bz2 ------- Comment #9 from henning dot m at insightbb dot com 2007-11-06 12:37 ------- (In reply to comment #8) > (In reply to comment #7) > > With Mike's description in comment #6, confirmed on 4.1.2 and 4.2.2. AVR GCC > > 4.2.2 is worse than 4.1.2, in that even if sub2 is called with (x+1), the > > variable is still 16 bits. > > > > There is something more going on, this is the assembler output when sub2 is not > in the same file, and calling sub2(x), i.e not x+1: > =================================================================== I think you will also find that if x is changed from ststic to auto the same problem appears. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33970