On Sep 29, 2015, at 1:59 PM, H.J. Lu <hjl.to...@gmail.com> wrote:
> commit f3a6675a8d69d810d2cad0c090a762094a0a8622
> Author: H.J. Lu <hjl.to...@gmail.com>
> Date:   Tue Sep 29 13:47:18 2015 -0700
> 
>    Define EPILOGUE_USES in i386 so that all preserved registers are used
>    by the epilogue of interrupt handler.  Don't explicitly mark BP and SP
>    registers as used since they are always used in epilogue.
> 
> Please take a look.

Oh, too bad you didn’t copy it here.  The easiest thing to blow is the addition 
of reload_completed && on the condition:

  /* An interrupt handler must preserve some registers that are                 
                                                                        
     ordinarily call-clobbered.  */
  if (reload_completed
      && myarch_interrupt_func (current_function_decl)
      && save_reg_p (regno))
    return true;

without it, the optimizer will blow chunks all over the place and code-gen will 
not be very good, if it doesn’t.  I’d love this to be shared across all ports, 
it it is cryptic and usually test cases are not elaborate enough to find the 
problem.  When we ported a large library to our system that made extensive uses 
of complex interrupt routines, the compiler blew chunks.  With lessor code, we 
never even noticed a problem.

Reply via email to