From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2491 invoked by alias); 3 Sep 2010 15:58:40 -0000 Received: (qmail 2429 invoked by uid 48); 3 Sep 2010 15:58:19 -0000 Date: Fri, 03 Sep 2010 15:58:00 -0000 Subject: [Bug tree-optimization/45522] New: VRP misses oppurtunity for statement folding. X-Bugzilla-Reason: CC Message-ID: 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/msg00472.txt.bz2 Hi, compiling the attached testcase (reduced from tree.c) with -O2 leads to vrp folding: if (D.2762_2 == 6) goto ; else goto ; : D.2766_5 = (int) D.2762_2; D.2767_6 = tree_code_type[D.2766_5]; into D.2762_2 = type_1(D)->base.code; if (D.2762_2 == 6) goto ; else goto ; : D.2766_5 = 6; D.2767_6 = tree_code_type[6]; this is good transform, however tree_code_type is constant initialized array and we miss possibility to fold it into constant until expansion triggering code in expr.c I would like to retire. We can fold tree_code_type[6], so apparently just no one calls fold_gimple_stmt on it? -- Summary: VRP misses oppurtunity for statement folding. Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hubicka at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45522