On Mon, Oct 13, 2014 at 5:01 PM, Evgeny Stupachenko <evstu...@gmail.com> wrote:
>>-#define PIC_OFFSET_TABLE_REGNUM \
>>-  ((TARGET_64BIT && (ix86_cmodel == CM_SMALL_PIC \
>>-                     || TARGET_PECOFF)) \
>>-   || !flag_pic ? INVALID_REGNUM \
>>-   : reload_completed ? REGNO (pic_offset_table_rtx) \
>>+#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)
>
>>No negative conditions, please. Also, please follow established
>>multi-level condition format, please see e.g. HARD_REGNO_NREGS
>>definition in i386.h.
> I don't see how we can avoid negative condition here. If we remove
> "not" from !flag_pic we'll need to add "not" to TARGET_64BIT and
> TARGET_PECOFF.
>
> I've done it this way:
> +#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)
>
> Is it ok?

Oh, indeed. I missed the logical or. Maybe put the first condition
into parenthesis, to avoid confusion.

OK in any case.

Thanks,
Uros.

Reply via email to