public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, i386]: Fix PR 56114, x86_64-linux-gnu-gcc generate wrong asm instruction MOVABS for intel syntax
@ 2013-01-27 13:21 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2013-01-27 13:21 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 487 bytes --]

Hello!

2013-01-27  Uros Bizjak  <ubizjak@gmail.com>

	PR target/56114
	* config/i386/i386.md (*movabs<mode>_1): Add square brackets around
	operand 0 in movabs insn template for -masm=intel asm alternative.
	(*movabs<mode>_2): Ditto for operand 1.

testsuite/ChangeLog:

2013-01-27  Uros Bizjak  <ubizjak@gmail.com>

	PR target/56114
	* gcc.target/i386/pr56114.c: New test.

Tested on x86_64-pc-linux-gnu, committed to mainline SVN, will be
backported to other release branches.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 1314 bytes --]

Index: config/i386/i386.md
===================================================================
--- config/i386/i386.md	(revision 195488)
+++ config/i386/i386.md	(working copy)
@@ -2308,7 +2308,7 @@
 	(match_operand:SWI1248x 1 "nonmemory_operand" "a,r<i>"))]
   "TARGET_LP64 && ix86_check_movabs (insn, 0)"
   "@
-   movabs{<imodesuffix>}\t{%1, %P0|%P0, %1}
+   movabs{<imodesuffix>}\t{%1, %P0|[%P0], %1}
    mov{<imodesuffix>}\t{%1, %a0|%a0, %1}"
   [(set_attr "type" "imov")
    (set_attr "modrm" "0,*")
@@ -2322,7 +2322,7 @@
         (mem:SWI1248x (match_operand:DI 1 "x86_64_movabs_operand" "i,r")))]
   "TARGET_LP64 && ix86_check_movabs (insn, 1)"
   "@
-   movabs{<imodesuffix>}\t{%P1, %0|%0, %P1}
+   movabs{<imodesuffix>}\t{%P1, %0|%0, [%P1]}
    mov{<imodesuffix>}\t{%a1, %0|%0, %a1}"
   [(set_attr "type" "imov")
    (set_attr "modrm" "0,*")
Index: testsuite/gcc.target/i386/pr56114.c
===================================================================
--- testsuite/gcc.target/i386/pr56114.c	(revision 0)
+++ testsuite/gcc.target/i386/pr56114.c	(working copy)
@@ -0,0 +1,10 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2 -masm=intel" } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target masm_intel } */
+
+long
+foo2 (void)
+{
+  return *(volatile int *) 0xFEE00000;
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-27 13:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-27 13:21 [PATCH, i386]: Fix PR 56114, x86_64-linux-gnu-gcc generate wrong asm instruction MOVABS for intel syntax Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).