Blame SOURCES/gcc48-rh1535655-5.patch

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