From patchwork Thu Jan 20 02:26:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 79634 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 43C50B6F07 for ; Thu, 20 Jan 2011 13:26:22 +1100 (EST) Received: (qmail 13034 invoked by alias); 20 Jan 2011 02:26:20 -0000 Received: (qmail 13025 invoked by uid 22791); 20 Jan 2011 02:26:19 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Jan 2011 02:26:14 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 19 Jan 2011 18:26:13 -0800 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by azsmga001.ch.intel.com with ESMTP; 19 Jan 2011 18:26:13 -0800 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 90B9D180D92; Wed, 19 Jan 2011 18:26:12 -0800 (PST) Date: Wed, 19 Jan 2011 18:26:12 -0800 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: [x32] PATCH: PR target/47369: [x32] internal compiler error: in extract_insn, at recog.c:2109 Message-ID: <20110120022612.GA19624@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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, I checkecd in this patch to allow ptr_mode for symbolic operand with PIC. H.J. --- commit 528d930544c6819f58267dda5ec54b051585caa1 Author: H.J. Lu Date: Wed Jan 19 18:23:34 2011 -0800 Allow ptr_mode for symbolic operand with PIC. diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32 index 36ac432..0bb8e16 100644 --- a/gcc/ChangeLog.x32 +++ b/gcc/ChangeLog.x32 @@ -1,5 +1,11 @@ 2011-01-19 H.J. Lu + PR target/47369 + * config/i386/i386.c (ix86_expand_move): Allow ptr_mode for + symbolic operand with PIC. + +2011-01-19 H.J. Lu + PR target/47364 * builtins.c (expand_builtin_strlen): Convert to Pmode if PAT isn't in Pmode. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 55732de..c3642e4 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -15323,7 +15323,8 @@ ix86_expand_move (enum machine_mode mode, rtx operands[]) } if ((flag_pic || MACHOPIC_INDIRECT) - && mode == Pmode && symbolic_operand (op1, Pmode)) + && (mode == Pmode || mode == ptr_mode) + && symbolic_operand (op1, mode)) { if (TARGET_MACHO && !TARGET_64BIT) { @@ -15364,13 +15365,15 @@ ix86_expand_move (enum machine_mode mode, rtx operands[]) else { if (MEM_P (op0)) - op1 = force_reg (Pmode, op1); - else if (!TARGET_64BIT || !x86_64_movabs_operand (op1, Pmode)) + op1 = force_reg (mode, op1); + else if (!TARGET_64BIT || !x86_64_movabs_operand (op1, mode)) { rtx reg = can_create_pseudo_p () ? NULL_RTX : op0; op1 = legitimize_pic_address (op1, reg); if (op0 == op1) return; + if (GET_MODE (op1) != mode) + op1 = convert_to_mode (mode, op1, 1); } } } diff --git a/gcc/testsuite/ChangeLog.x32 b/gcc/testsuite/ChangeLog.x32 index 4b1e5f8..79ac672 100644 --- a/gcc/testsuite/ChangeLog.x32 +++ b/gcc/testsuite/ChangeLog.x32 @@ -1,5 +1,10 @@ 2011-01-19 H.J. Lu + PR target/47369 + * gcc.target/i386/pr47369-1.c: New. + +2011-01-19 H.J. Lu + PR target/47364 * gcc.target/i386/pr47364-2.c: New. diff --git a/gcc/testsuite/gcc.target/i386/pr47369-1.c b/gcc/testsuite/gcc.target/i386/pr47369-1.c new file mode 100644 index 0000000..117b03b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr47369-1.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target fpic } */ +/* { dg-options "-O2 -fPIC" } */ + +struct FILE +{ + int x; +}; +extern struct FILE __sF[]; +extern void bar (struct FILE *); +void dlmalloc_stats() { + bar ((&__sF[2])); +}