From patchwork Wed Dec 7 21:45:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Teresa Johnson X-Patchwork-Id: 130042 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 12BB41007D5 for ; Thu, 8 Dec 2011 08:45:36 +1100 (EST) Received: (qmail 20366 invoked by alias); 7 Dec 2011 21:45:34 -0000 Received: (qmail 20354 invoked by uid 22791); 7 Dec 2011 21:45:32 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, TW_CP, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Dec 2011 21:45:19 +0000 Received: by qadb17 with SMTP id b17so3989056qad.20 for ; Wed, 07 Dec 2011 13:45:18 -0800 (PST) Received: by 10.224.173.199 with SMTP id q7mr290367qaz.21.1323294318505; Wed, 07 Dec 2011 13:45:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.173.199 with SMTP id q7mr290360qaz.21.1323294318400; Wed, 07 Dec 2011 13:45:18 -0800 (PST) Received: by 10.229.79.1 with HTTP; Wed, 7 Dec 2011 13:45:18 -0800 (PST) Date: Wed, 7 Dec 2011 13:45:18 -0800 Message-ID: Subject: [Patch, i386] [4.6] Backport movd*_internal_rex64 fix from trunk and [4.6/4.7] add testcase From: Teresa Johnson To: gcc-patches@gcc.gnu.org X-System-Of-Record: true X-IsSubscribed: yes 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 An issue turned up in our internal 4.6 based testing that has been fixed on trunk. This patch backports the fix to 4.6. I also have a small test case that I will add to both 4.6 and 4.7. Bootstrapped and checked with x86_64-unknown-linux-gnu. Can someone review? Thanks, Teresa 2011-12-07 Teresa Johnson Backport from mainline: 2011-08-05 Uros Bizjak * config/i386/i386.md (*movdi_internal_rex64): Use "!o" constraint instead of "!m" for operand 0, alternative 4. (*movdf_internal_rex64): Ditto for operand 0, alernative 6. 2011-12-07 Teresa Johnson * gcc.target/i386/movdi-rex64.c: New. Index: config/i386/i386.md===================================================================--- config/i386/i386.md (revision 182083)+++ config/i386/i386.md (working copy)@@ -1960,7 +1960,7 @@  (define_insn "*movdi_internal_rex64" [(set (match_operand:DI 0 "nonimmediate_operand"-  "=r,r  ,r,m ,!m,*y,*y,?r ,m ,?*Ym,?*y,*x,*x,?r ,m,?*Yi,*x,?*x,?*Ym")+  "=r,r ,r,m ,!o,*y,*y,?r ,m ,?*Ym,?*y,*x,*x,?r ,m,?*Yi,*x,?*x,?*Ym") (match_operand:DI 1 "general_operand"   "Z ,rem,i,re,n ,C ,*y,*Ym,*y,r   ,m  ,C ,*x,*Yi,*x,r  ,m ,*Ym,*x"))]   "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))"@@ -2905,7 +2905,7 @@ (define_insn "*movdf_internal_rex64"   [(set (match_operand:DF 0 "nonimmediate_operand"- "=f,m,f,r ,m,!r,!m,Y2*x,Y2*x,Y2*x,m   ,Yi,r ")+ "=f,m,f,r ,m,!r,!o,Y2*x,Y2*x,Y2*x,m   ,Yi,r ")  (match_operand:DF 1 "general_operand"  "fm,f,G,rm,r,F ,F ,C   ,Y2*x,m   ,Y2*x,r ,Yi"))]  "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1])) Index: testsuite/gcc.target/i386/movdi-rex64.c =================================================================== --- testsuite/gcc.target/i386/movdi-rex64.c (revision 0) +++ testsuite/gcc.target/i386/movdi-rex64.c (revision 0) @@ -0,0 +1,11 @@ +/* { dg-do compile { target *-*-linux* } } */ +/* { dg-options "-fPIE -Wwrite-strings" } */ + +#include +static __thread char buffer[25]; +const char * error_message (void) +{ +oops: + strcpy (buffer, "Unknown code "); + return 0; +}