From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16608 invoked by alias); 15 Oct 2008 21:30:10 -0000 Received: (qmail 15261 invoked by uid 48); 15 Oct 2008 21:28:49 -0000 Date: Wed, 15 Oct 2008 21:30:00 -0000 Message-ID: <20081015212849.15260.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/37573] [4.4 Regression] gcc-4.4 regression: incorrect code generation with -O1 -ftree-vectorize 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: 2008-10/txt/msg01028.txt.bz2 ------- Comment #7 from spop at gcc dot gnu dot org 2008-10-15 21:28 ------- split_constant_offset does not handle correctly the offset of &s.c[1] as this is an ADDR_EXPR whose op0 was set by extract_ops_from_tree to itself, an ADDR_EXPR. Now this code is not handled in split_constant_offset_1 as this calls if (!handled_component_p (op0)) return false; and returns false. This is an early return that stops the extraction of the base address of the array: s.c[0] and the offset 4. This is probably due to the fact that extract_ops_from_tree does return the expression itself for ADDR_EXPRs in this case: else if (grhs_class == GIMPLE_SINGLE_RHS) { *op1_p = expr; *op2_p = NULL_TREE; } I wonder if the fix could be to handle ADDR_EXPRs as GIMPLE_UNARY_RHS instead of GIMPLE_SINGLE_RHS: else if (grhs_class == GIMPLE_UNARY_RHS) { *op1_p = TREE_OPERAND (expr, 0); *op2_p = NULL_TREE; } in which case that would solve the base and offset computations. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37573