From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30035 invoked by alias); 7 Aug 2010 16:25:51 -0000 Received: (qmail 29943 invoked by uid 48); 7 Aug 2010 16:25:35 -0000 Date: Sat, 07 Aug 2010 16:25:00 -0000 Message-ID: <20100807162535.29942.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: "rguenth at gcc dot gnu dot org" 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/msg00534.txt.bz2 ------- Comment #8 from rguenth at gcc dot gnu dot org 2010-08-07 16:25 ------- Which means that if the language guarantees that for Base2* fooA(Derived* x) { Base2& y = *x; return &y; } x being a null pointer invokes undefined behavior (because references can't bind to nothing(?)) then the frontend should emit not < != 0B ? &NON_LVALUE_EXPR ->D.1702 : 0B);>>; but instead <->D.1702;>>; CCing Jason. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45221