This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Enable EBX for x86 in 32bits PIC code


On Mon, 25 Aug 2014, Ilya Enkovich wrote:
> 2014-08-23 5:47 GMT+04:00 Hans-Peter Nilsson <hp@bitrange.com>:
> > ...did you send the right version of the patch?
> > This one uses the RTX-returning hook only in boolean tests,
> > unless I misread.

(I did, but not by much.)

> NULL returned by hook means we do not have implicit pic arg to
> pass/receive and there are pieces of code which should be executed
> only when implicit pic arg exists.  This causes these boolean tests.

Well, obviously, but...

> There are also non boolean usages. E.g.:

I thing singular ("usage") is more correct?
I saw only one such use. :)

> +      rtx old_reg = targetm.calls.implicit_pic_arg (fndecl);
> +      rtx new_reg = gen_reg_rtx (GET_MODE (old_reg));
> +      emit_move_insn (new_reg, old_reg);
> +      pic_offset_table_rtx = new_reg;

And before that, it's called as a boolean test, throwing away
the result!

I suggest you change the hook to return a boolean, with a
pointer argument to a variable to set, passed as NULL from
callers not interested in the actual value.

I.e. instead of:

> >> +@deftypefn {Target Hook} rtx TARGET_IMPLICIT_PIC_ARG (const_tree @var{fntype_or_decl})

make it a:

@deftypefn {Target Hook} bool TARGET_IMPLICIT_PIC_ARG
 (const_tree @var{fntype_or_decl}, rtx *@var{addr})

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]