Blame SOURCES/gcc48-rh1535655-5.patch

56d343
commit 6effbc703b711779a196e5dbaf6335f39fab71c2
56d343
Author: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
56d343
Date:   Tue Jan 16 11:19:51 2018 +0000
56d343
56d343
    HJ patch #4
56d343
56d343
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
56d343
index 9dffd02f..e73389b 100644
56d343
--- a/gcc/config/i386/i386.c
56d343
+++ b/gcc/config/i386/i386.c
56d343
@@ -14497,6 +14497,7 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, bool reverse,
56d343
    If CODE is 'h', pretend the reg is the 'high' byte register.
56d343
    If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op.
56d343
    If CODE is 'd', duplicate the operand for AVX instruction.
56d343
+   If CODE is 'V', print naked full integer register name without %.
56d343
  */
56d343
 
56d343
 void
56d343
@@ -14506,7 +14507,7 @@ print_reg (rtx x, int code, FILE *file)
56d343
   unsigned int regno;
56d343
   bool duplicated = code == 'd' && TARGET_AVX;
56d343
 
56d343
-  if (ASSEMBLER_DIALECT == ASM_ATT)
56d343
+  if (ASSEMBLER_DIALECT == ASM_ATT && code != 'V')
56d343
     putc ('%', file);
56d343
 
56d343
   if (x == pc_rtx)
56d343
@@ -14542,6 +14543,14 @@ print_reg (rtx x, int code, FILE *file)
56d343
   else
56d343
     code = GET_MODE_SIZE (GET_MODE (x));
56d343
 
56d343
+  if (code == 'V')
56d343
+    {
56d343
+      if (GENERAL_REGNO_P (regno))
56d343
+	code = GET_MODE_SIZE (word_mode);
56d343
+      else
56d343
+	error ("'V' modifier on non-integer register");
56d343
+    }
56d343
+
56d343
   /* Irritatingly, AMD extended registers use different naming convention
56d343
      from the normal registers: "r%d[bwd]"  */
56d343
   if (REX_INT_REGNO_P (regno))
56d343
@@ -14695,6 +14704,7 @@ get_some_local_dynamic_name (void)
56d343
    & -- print some in-use local-dynamic symbol name.
56d343
    H -- print a memory address offset by 8; used for sse high-parts
56d343
    Y -- print condition for XOP pcom* instruction.
56d343
+   V -- print naked full integer register name without %.
56d343
    + -- print a branch hint as 'cs' or 'ds' prefix
56d343
    ; -- print a semicolon (after prefixes due to bug in older gas).
56d343
    ~ -- print "i" if TARGET_AVX2, "f" otherwise.
56d343
@@ -14919,6 +14929,7 @@ ix86_print_operand (FILE *file, rtx x, int code)
56d343
 	case 'X':
56d343
 	case 'P':
56d343
 	case 'p':
56d343
+	case 'V':
56d343
 	  break;
56d343
 
56d343
 	case 's':
56d343
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c
56d343
new file mode 100644
56d343
index 0000000..f0cd9b7
56d343
--- /dev/null
56d343
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c
56d343
@@ -0,0 +1,13 @@
56d343
+/* { dg-do compile } */
56d343
+/* { dg-options "-O2 -mindirect-branch=keep -fno-pic" } */
56d343
+
56d343
+extern void (*func_p) (void);
56d343
+
56d343
+void
56d343
+foo (void)
56d343
+{
56d343
+  asm("call __x86_indirect_thunk_%V0" : : "a" (func_p));
56d343
+}
56d343
+
56d343
+/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_eax" { target ia32 } } } */
56d343
+/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_rax" { target { ! ia32 } } } } */