From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21289 invoked by alias); 23 Mar 2012 02:30:07 -0000 Received: (qmail 21236 invoked by uid 22791); 23 Mar 2012 02:30:05 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Mar 2012 02:29:50 +0000 From: "meadori at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/52672] internal compiler error: in cxx_eval_indirect_ref, at cp/semantics.c:6766 Date: Fri, 23 Mar 2012 05:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: meadori at codesourcery dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Version Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-03/txt/msg02003.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52672 Meador Inge changed: What |Removed |Added ---------------------------------------------------------------------------- Version|4.6.4 |4.8.0 --- Comment #1 from Meador Inge 2012-03-23 02:29:46 UTC --- Actually I found a smaller repro that also triggers in trunk: typedef unsigned long * ul_ptr; constexpr void * a = (void*) ((ul_ptr)(((ul_ptr)0x01000010)[14]))[0]; The problem happens when 'cxx_eval_indirect_ref' is presented with an indirect reference expression that looks like: unit size align 32 symtab 0 alias set -1 canonical type 0xf7c524e0 precision 32 min max pointer_to_this > arg 0 unsigned SI size unit size align 32 symtab 0 alias set -1 canonical type 0xf7dc9cc0> arg 0 arg 0 /home/meadori/etc/bugs/issue13031.cpp:3:63> /home/meadori/etc/bugs/issue13031.cpp:3:68> /home/meadori/etc/bugs/issue13031.cpp:3:68> It calls into 'cxx_fold_indirect_ref' to fold the indirect reference operand and ends up stripping the NOP cast ending up with: unit size align 32 symtab 0 alias set -1 canonical type 0xf7c524e0 precision 32 min max pointer_to_this > arg 0 constant 16777288> which, of course, fails the 'gcc_assert (POINTER_TYPE_P (subtype));' assert in 'cxx_fold_indirect_ref'. I would like to work out a patch for this one. Any tips would be appreciated.