From patchwork Mon Jan 3 23:59:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 77357 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 389C6B70E0 for ; Tue, 4 Jan 2011 11:01:22 +1100 (EST) Received: (qmail 11701 invoked by alias); 4 Jan 2011 00:01:20 -0000 Received: (qmail 11693 invoked by uid 22791); 4 Jan 2011 00:01:20 -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) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Jan 2011 00:01:16 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 14A0DCB0261 for ; Tue, 4 Jan 2011 01:01:14 +0100 (CET) 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 m-RZW8zI3BYU for ; Tue, 4 Jan 2011 01:01:14 +0100 (CET) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id E739FCB025D for ; Tue, 4 Jan 2011 01:01:13 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix PR middle-end/47017 Date: Tue, 4 Jan 2011 00:59:09 +0100 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201101040059.09592.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 This is another installment in the "RTL expansion of MEM_REF" series. To recap, after the initial merge, Richard tweaked it to unbreak IA-64/HP-UX: http://gcc.gnu.org/ml/gcc-patches/2010-07/msg00514.html which broke SPARC64/Linux. So I reverted the above change and installed: http://gcc.gnu.org/ml/gcc-patches/2010-07/msg02144.html instead, which pessimized x86. So Jakub partially reverted it: http://gcc.gnu.org/ml/gcc-patches/2010-11/msg00551.html which broke SPARC64/Linux again (in exactly the same way as before). The attached patchlet fixes again SPARC64/Linux by turning the call to convert_memory_address_addr_space into a call to memory_address_addr_space, which additionally makes sure that the memory address is valid. Bootstrapped/regtested on SPARC64 and AMD64 Linux, applied on the mainline. 2011-01-03 Eric Botcazou PR middle-end/47017 * expr.c (expand_expr_real_1) : Call memory_address_addr_space instead of convert_memory_address_addr_space on the base expression. Index: expr.c =================================================================== --- expr.c (revision 168391) +++ expr.c (working copy) @@ -8731,7 +8731,7 @@ expand_expr_real_1 (tree exp, rtx target align = MAX (TYPE_ALIGN (TREE_TYPE (exp)), get_object_alignment (exp, BIGGEST_ALIGNMENT)); op0 = expand_expr (base, NULL_RTX, VOIDmode, EXPAND_SUM); - op0 = convert_memory_address_addr_space (address_mode, op0, as); + op0 = memory_address_addr_space (address_mode, op0, as); if (!integer_zerop (TREE_OPERAND (exp, 1))) { rtx off