From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2598 invoked by alias); 8 Aug 2005 19:54:33 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 2536 invoked by uid 48); 8 Aug 2005 19:54:25 -0000 Date: Mon, 08 Aug 2005 19:54:00 -0000 Message-ID: <20050808195425.2535.qmail@sourceware.org> From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050808174631.23286.bonzini@gcc.gnu.org> References: <20050808174631.23286.bonzini@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/23286] missed fully redundant expression X-Bugzilla-Reason: CC X-SW-Source: 2005-08/txt/msg00899.txt.bz2 List-Id: ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-08 19:54 ------- Here is a stupid testcase which can be sped up by pulling the reduandant expressions up: int ii; static inline int f(int i, int ii) { return i/ ii; } int h(int) __attribute__((pure,const)); int g(int i) { int j, j1 = i; for (j = 0; j <1000; j++) { int ii1 = ii; if (h(j)) i = j1/ii1 + 2; else i = j1/ii1; } return i; } As we then pull the division before the loop. As I said this was stupid as this was made up and I don't know how often this happens in real life. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23286