From patchwork Wed Jul 28 09:53:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 60129 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id F08E0B6EE8 for ; Wed, 28 Jul 2010 19:53:45 +1000 (EST) Received: (qmail 30102 invoked by alias); 28 Jul 2010 09:53:43 -0000 Received: (qmail 30093 invoked by uid 22791); 28 Jul 2010 09:53:42 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Jul 2010 09:53:26 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 199CCCB02C9 for ; Wed, 28 Jul 2010 11:53:21 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id da7VY+ugcVxM for ; Wed, 28 Jul 2010 11:53:21 +0200 (CEST) Received: from adijon-256-1-81-25.w86-204.abo.wanadoo.fr (ADijon-256-1-81-25.w86-204.abo.wanadoo.fr [86.204.0.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id E8756CB02BA for ; Wed, 28 Jul 2010 11:53:20 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR tree-optimization/44885 Date: Wed, 28 Jul 2010 11:53:26 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201007281153.26503.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, this is the failure of gnat.dg/aliasing3.adb on 32-bit platforms exposed by the mem-ref2 merge. But the root cause is a latent problem in IPA-SRA: the pass takes the address of a component of a TYPE_NONALIASED_COMPONENT array. Proposed fix attached, tested on x86-64-suse-linux, OK for mainline? 2010-07-28 Eric Botcazou PR tree-optimization/44885 * tree-sra.c (find_param_candidates): Skip pointer types to arrays with non-aliased component. Index: tree-sra.c =================================================================== --- tree-sra.c (revision 162618) +++ tree-sra.c (working copy) @@ -3147,6 +3147,8 @@ find_param_candidates (void) if (TREE_CODE (type) == FUNCTION_TYPE || TYPE_VOLATILE (type) + || (TREE_CODE (type) == ARRAY_TYPE + && TYPE_NONALIASED_COMPONENT (type)) || !is_gimple_reg (parm) || is_va_list_type (type) || ptr_parm_has_direct_uses (parm))