diff mbox

[i386] Never fix register for PIC when pseudo PIC reg is used

Message ID CAFULd4ZPaBEDHzcvqg_GePZAv65cE3imPheLuAJF5Ei6ZiqR=Q@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak Jan. 29, 2015, 8:13 a.m. UTC
On Wed, Jan 28, 2015 at 5:03 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
>> Currently ix86_conditional_register_usage code may mark EBX as a fixed register if it is called
>> when pic_offset_table_rtx is NULL even if we are going to use pseudo PIC register.  It already
>> caused some problem in combination with another issue (PR jit/64722).  This patch will probably
>> help to avoid problems in the future.
>>
>> BTW if we don't want to support possibility to switch to the fixed PIC register in i386 target then
>> this code may be removed at all.
>
> No, we don't want to switch to fixed PIC register. cpuid asm in
> cpuid.h and cmpxchg8b pattern will break. Please do not bring back the
> dead and remove this code.

Also, if possible, please simplify PIC_OFFSET_TABLE_REGNUM to use
TARGET_USE_PSEUDO_PIC_REG, like:


 #define GOT_SYMBOL_NAME "_GLOBAL_OFFSET_TABLE_"

Uros.
diff mbox

Patch

Index: config/i386/i386.h
===================================================================
--- config/i386/i386.h  (revision 220230)
+++ config/i386/i386.h  (working copy)
@@ -1256,13 +1256,11 @@ 
 #define REAL_PIC_OFFSET_TABLE_REGNUM  (TARGET_64BIT ? R15_REG : BX_REG)

 #define PIC_OFFSET_TABLE_REGNUM
         \
-  ((TARGET_64BIT && (ix86_cmodel == CM_SMALL_PIC                       \
-                     || TARGET_PECOFF))
         \
-   || !flag_pic
         \
-   ? INVALID_REGNUM                                                    \
-   : pic_offset_table_rtx                                              \
-     ? INVALID_REGNUM                                                  \
-     : REAL_PIC_OFFSET_TABLE_REGNUM)
+  (TARGET_USE_PSEUDO_PIC_REG                                           \
+   ? (pic_offset_table_rtx                                             \
+      ? INVALID_REGNUM                                                 \
+      : REAL_PIC_OFFSET_TABLE_REGNUM)                                  \
+   : INVALID_REGNUM)