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: i686 pic & DCmode


On Wed, Aug 7, 2013 at 10:34 AM, Nathan Sidwell <nathan@acm.org> wrote:
> Having poked further, I find this in the testsuite:
>
> pr11001-strlen-2.c
> --begin
> register int regvar asm("%eax");
>
> char *
> do_copy (char *str)
> {
>   return malloc (strlen (str) + 1);
> }
> --end
>
> Is that even meaningful?  The doc's for a global reg var say:
> 'Choose a register that is normally saved and restored by function calls on
> your
> machine, so that library routines will not clobber it.'

This is risky but meaningful, and potentially useful with asm
instructions.

> If one never made calls to a library unaware of the reg's global use, things
> would be ok.  Except if one chose a register that is used by the ABI to
> return things, or by the pro/epilogue code as a scratch register.
>
> Should attempts to use a call_used reg as a global reg var generate an
> error?

No.  Perhaps a warning.

> Should it stop it being marked as a fixed_reg?

Definitely not.

Ian


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