Re: Question about sibling call epilogues & registers

2016-10-17 Thread Daniel Santos
It would probably be useful to post the actual code. The below function emit_msabi_outlined_restore() is is called from ix86_expand_epilogue() to emit the RTL to call the restore stub. Like ix86_expand_epilogue, it uses style == 0 to indicate that there will be a sibling call following the epil

Re: Question about sibling call epilogues & registers

2016-10-16 Thread Daniel Santos
I think I've finally found the problem. It would appear that if you do not explicitly add a note of type REG_CALL_DECL that specifies the function declaration then it will ignore whatever you've supplied with add_function_usage_to(). Instead, it will replace it with the target's default regist

Re: Question about sibling call epilogues & registers

2016-10-16 Thread Daniel Santos
On 10/16/2016 05:27 PM, Segher Boessenkool wrote: Oddly enough, I had forgotten to call add_function_usage_to() on my save stub (which I didn't post), but not the restore stub. So thanks for that psychic intervention. :) But if you look carefully, it's there, although it's hard to read because

Re: Question about sibling call epilogues & registers

2016-10-16 Thread Segher Boessenkool
On Sun, Oct 16, 2016 at 05:05:17PM -0500, Daniel Santos wrote: > >>The insn that's getting deleted is 75, where RCX is set. I'm starting > >>to think that maybe df_analyze() presumes that my call (to the stub) is > >>invalidating RCX, although it does not. > >It looks like you don't use add_functi

Re: Question about sibling call epilogues & registers

2016-10-16 Thread Daniel Santos
On 10/15/2016 08:41 PM, Segher Boessenkool wrote: Hi Daniel, On Sat, Oct 15, 2016 at 01:45:12AM -0500, Daniel Santos wrote: The insn that's getting deleted is 75, where RCX is set. I'm starting to think that maybe df_analyze() presumes that my call (to the stub) is invalidating RCX, although i

Re: Question about sibling call epilogues & registers

2016-10-15 Thread Segher Boessenkool
Hi Daniel, On Sat, Oct 15, 2016 at 01:45:12AM -0500, Daniel Santos wrote: > The insn that's getting deleted is 75, where RCX is set. I'm starting > to think that maybe df_analyze() presumes that my call (to the stub) is > invalidating RCX, although it does not. It looks like you don't use add_