From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16675 invoked by alias); 17 Jun 2007 19:13:57 -0000 Received: (qmail 16630 invoked by alias); 17 Jun 2007 19:13:46 -0000 Date: Sun, 17 Jun 2007 19:13:00 -0000 Message-ID: <20070617191346.16629.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/32367] [4.3 Regression] internal compiler error: in build_polynomial_chrec, at tree-chrec.h:113 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "spop 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: 2007-06/txt/msg01367.txt.bz2 ------- Comment #11 from spop at gcc dot gnu dot org 2007-06-17 19:13 ------- Subject: Re: [4.3 Regression] internal compiler error: in build_polynomial_chrec, at tree-chrec.h:113 The ptrplus patch contains the following code: *************** interpret_rhs_modify_stmt (struct loop * *** 1611,1616 **** --- 1615,1630 ---- switch (TREE_CODE (opnd1)) { + case POINTER_PLUS_EXPR: + opnd10 = TREE_OPERAND (opnd1, 0); + opnd11 = TREE_OPERAND (opnd1, 1); + chrec10 = analyze_scalar_evolution (loop, opnd10); + chrec11 = analyze_scalar_evolution (loop, opnd11); + chrec10 = chrec_convert (type, chrec10, at_stmt); + chrec11 = chrec_convert (sizetype, chrec11, at_stmt); + res = chrec_fold_plus (type, chrec10, chrec11); + break; + case PLUS_EXPR: opnd10 = TREE_OPERAND (opnd1, 0); opnd11 = TREE_OPERAND (opnd1, 1); At this point we have the following values: (gdb) call debug_generic_expr (chrec10) {ptr_7, +, (unsigned int) (n_20 + 65535) * 4}_1 (gdb) call debug_generic_expr (chrec11) (unsigned int) {n_6 + 65535, +, 1}_1 * 4 (gdb) call debug_generic_expr (res) {ptr_7 + (unsigned int) {n_6 + 65535, +, 1}_1 * 4, +, (unsigned int) (n_20 + 65535) * 4}_1 chrec_fold_plus is completely disturbed by the "complicated" MULT_EXPR "{}_1 * 4", and just considers this expression to be constant, and finally it builds "ptr_7 + (unsigned int) {n_6 + 65535, +, 1}_1 * 4". The code in chrec_fold_multiply that is producing this MULT_EXPR is: return fold_build2 (MULT_EXPR, type, op0, op1); (gdb) p op0 $42 = (tree) 0xb7c27444 (gdb) pgs 4 (gdb) p op1 $43 = (tree) 0xb7ccf6a0 (gdb) pgs (unsigned int) (n_20 + 65535); (gdb) pt unit size align 32 symtab 0 alias set -1 canonical type 0xb7c3c0d8 precision 32 min max > arg 0 unit size align 16 symtab 0 alias set -1 canonical type 0xb7c36288 precision 16 min max > arg 0 var def_stmt version 20> arg 1 >> And here, unfortunately fold_build2 does not further simplify this expression because of the cast to uint around the PLUS_EXPR. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32367