diff mbox

[i386,4.6] Backport movd*_internal_rex64 fix from trunk and [4.6/4.7] add testcase

Message ID CAAe5K+V0chXpxd46gZ0dG6sN-UxKOqQEOtox9=U39MWndL3GrQ@mail.gmail.com
State New
Headers show

Commit Message

Teresa Johnson Dec. 7, 2011, 9:45 p.m. UTC
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  <tejohnson@google.com>

	Backport from mainline:

	2011-08-05  Uros Bizjak  <ubizjak@gmail.com>

	* 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  <tejohnson@google.com>

	* gcc.target/i386/movdi-rex64.c: New.
diff mbox

Patch

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 <string.h>
+static __thread char buffer[25];
+const char * error_message (void)
+{
+oops:
+    strcpy (buffer, "Unknown code ");
+    return 0;
+}