From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32668 invoked by alias); 18 Apr 2005 03:06:13 -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 32659 invoked by uid 48); 18 Apr 2005 03:06:10 -0000 Date: Mon, 18 Apr 2005 03:06:00 -0000 From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20050418030609.21082.pinskia@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug middle-end/21082] New: &a[b] - &a[c] is not folded to b - c X-Bugzilla-Reason: CC X-SW-Source: 2005-04/txt/msg02371.txt.bz2 List-Id: The following C++ code is not fully as optimizated as the C version: typedef __SIZE_TYPE__ size_t; size_t a[100]; size_t f(size_t b, size_t c) { return &a[b] - &a[c]; } Found this while looking into the tree dump for mgrid. -- Summary: &a[b] - &a[c] is not folded to b - c Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P2 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21082