From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8722 invoked by alias); 3 Sep 2010 16:33:57 -0000 Received: (qmail 8578 invoked by uid 48); 3 Sep 2010 16:33:26 -0000 Date: Fri, 03 Sep 2010 16:33:00 -0000 Message-ID: <20100903163326.8577.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/45522] VRP misses oppurtunity for statement folding. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "hubicka 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-09/txt/msg00477.txt.bz2 ------- Comment #2 from hubicka at gcc dot gnu dot org 2010-09-03 16:33 ------- OK, the problem seems to be that fold_stmt seems to make no serious attempt to fold constant references. There is some code in maybe_fold_reference that seems to partly duplicate fold_const_aggregate_ref however. What is reason for that? The following patch solves the problem, I am looking what other testcases I can find. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45522