This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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  <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.

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;
+}

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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]