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: Emit more REG_EQUIV notes for function args (PR42235)


On 07/14/10 15:30, Bernd Schmidt wrote:
On 07/14/2010 08:54 PM, Jeff Law wrote:
On 07/14/10 05:14, Bernd Schmidt wrote:
When moving arguments into pseudos, we are being very careful not to
emit any instructions that could possibly clobber other argument
registers.  Currently, we generate unnecessarily complicated sequences
of code for simple zero or sign extensions.

With this patch, we check can_extend_p and the necessary predicates to
see if an extend insn is available for the conversion we have to do.
Right, but what guarantee do we have that the conversion insn doesn't
clobber a function argument register?   ISTM that to be safe you
actually have to scan the insns created by gen_extend_insn to ensure
they don't clobber something important.

I'm not an expert on what ports do these days, but I did work on a port
(mn10200) where conversion "insns" where implemented as special function
calls under the hood. I don't recall if we allowed those special
function calls to have visible side effects, but if they did, they'd
show up as clobbers/uses attached to the normal conversion insn. Of
course the mn102 is dead, but I think it's method for implementing
conversions was valid and if another port were to do something similar
it would likely not interact well with your change.
Hmm, ok. That's awful, but I kind of expected someone would say that.
Did this really happen for integer zero/sign extend, or only for
floating point stuff?
It was all the PSImode crap.

If necessary I can try to test for a single insn with single_set and
push it to the sequence otherwise.
For the mn103, the conversions were single insns...

Ultimately, I think you have to peek at the insn(s) and see what registers they set/clobber.

jeff



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