From patchwork Wed Dec 7 22:12:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 130047 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 1B4F91007D7 for ; Thu, 8 Dec 2011 09:12:59 +1100 (EST) Received: (qmail 29419 invoked by alias); 7 Dec 2011 22:12:57 -0000 Received: (qmail 29410 invoked by uid 22791); 7 Dec 2011 22:12:56 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_CP, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Dec 2011 22:12:43 +0000 Received: by ghrr13 with SMTP id r13so1012321ghr.20 for ; Wed, 07 Dec 2011 14:12:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.193.68 with SMTP id j44mr624446yhn.97.1323295962766; Wed, 07 Dec 2011 14:12:42 -0800 (PST) Received: by 10.147.111.1 with HTTP; Wed, 7 Dec 2011 14:12:42 -0800 (PST) Date: Wed, 7 Dec 2011 23:12:42 +0100 Message-ID: Subject: Re: [Patch, i386] [4.6] Backport movd*_internal_rex64 fix from trunk and [4.6/4.7] add testcase From: Uros Bizjak To: gcc-patches@gcc.gnu.org Cc: Teresa Johnson 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 Hello! > 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. > > 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. You don't need #include for compile tests, just use: --cut here-- /* { dg-do compile } */ /* { dg-options "-fPIE" } */ char *strcpy (char *dest, const char *src); static __thread char buffer[25]; const char * error_message (void) { strcpy (buffer, "Unknown code "); return 0; } --cut here-- Also this can be compiled everywhere, not just linux. OK with the testcase above. Thanks, Uros. 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; +}