From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26908 invoked by alias); 7 Aug 2010 15:26:04 -0000 Received: (qmail 26811 invoked by uid 48); 7 Aug 2010 15:25:46 -0000 Date: Sat, 07 Aug 2010 15:26:00 -0000 Message-ID: <20100807152546.26810.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/45221] missed optimization with multiple bases and casting In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "navin dot kumar at gmail 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: 2010-08/txt/msg00529.txt.bz2 ------- Comment #5 from navin dot kumar at gmail dot com 2010-08-07 15:25 ------- Hi Richard, Your explanation doesn't explain why foo1 would emit poorer assembly than foo3. Or for that matter why fooA would emit poorer assembly than fooB. In the case of foo1, foo3, fooA, and fooB, dereferencing occurs first, before casting. Yet only foo3 and fooB generate optimal assembly (so gcc is clearly "capable" of outputting the desired asm). This is all at -O3, where "-fdelete-null-pointer-checks" is already enabled. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45221