Blame SOURCES/gcc48-rh1535655-5.patch

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