From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5392 invoked by alias); 20 Apr 2009 23:50:25 -0000 Received: (qmail 5338 invoked by uid 48); 20 Apr 2009 23:50:11 -0000 Date: Mon, 20 Apr 2009 23:50:00 -0000 Subject: [Bug tree-optimization/39829] New: [4.5 Regression] ICE with some code that produces VCE X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia 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: 2009-04/txt/msg01698.txt.bz2 A simple testcase: void foo (void * DAG_temp117584) { char uA; void* pA; void* pB; void* pC; do { int DAG_temp117585; int DAG_temp117586; void ** __indir_union1 = (void**)DAG_temp117584; DAG_temp117585 = *__indir_union1; DAG_temp117586 = DAG_temp117585; if ( DAG_temp117586 != (int)268435456 ) pA = (void*)&uA; pB = (void*)&pA; pC = pB; union __block_indir0_u { struct { int val; } __indir_struct; } * __indir_union = (union __block_indir0_u*)pC; f(__indir_union->__indir_struct.val); DAG_temp117584 += 64; } while (1); } ---- CUT --- Compile at -O1, we get the following ICE: gcc/gcc/testsuite/gcc.c-torture/compile/20090206-2.c:19: internal compiler error: in expand_expr_addr_expr_1, at expr.c:6817 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. If we compile with -O2, we get: gcc/gcc/testsuite/gcc.c-torture/compile/20090206-2.c:1: internal compiler error: in verify_expr, at tree-cfg.c:2876 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. forwprop1 produces: D.1591_10 = VIEW_CONVERT_EXPR(pA).__indir_struct.val; CCP2 produces: D.1591_10 = VIEW_CONVERT_EXPR(&uA).__indir_struct.val; And then somewhere we must lose that the address of uA is taken because with -O2 PRE creates: uA.18_15 = uA_11(D); D.2674_1 = uA.18_15; D.2676_8 = D.2674_1; D.2675_7 = &D.2676_8; pretmp.19_13 = VIEW_CONVERT_EXPR(D.2675_7).__indir_struct.val; Which is just incorrect. -- Summary: [4.5 Regression] ICE with some code that produces VCE Product: gcc Version: 4.5.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39829