This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Re: m68k attribute interrupt


I wrote:

>  Here are my patches, derived from the Michael's patches.
> 
>   #define MUST_SAVE_REGISTER(regno)                                     \
>    (! TREE_THIS_VOLATILE (current_function_decl)                        \
>      && ! STACK_POINTER_REGNO (regno)                                   \
>      /* Save any call saved register that was used.  */                 \

 The STACK_POINTER_REGNO() was just bullshit, the regnos are named with macros
like STACK_POINTER_REGNUM, so the previous save conditons macro could be:

#define MUST_SAVE_REGISTER(regno)					\
 (! TREE_THIS_VOLATILE (current_function_decl)				\
  && (regno != STACK_POINTER_REGNUM)					\
  /* Save any call saved register that was used.  */			\
  && ((regs_ever_live[regno] && !call_used_regs[regno])			\
    /* Save any register used in an interrupt handler.  */		\
    || (regs_ever_live[regno] && interrupt_handler) 			\
    /* Save call clobbered registers in non-leaf interrupt handlers. */	\
    || (call_used_regs[regno] && interrupt_handler && !current_function_is_leaf)))

 Also a pair of parentheses have been added, just for clarity. These conditions
handle also the 'normal', 'noreturn' etc. functions.

 Handling the frame pointer in an 'noreturn' function may also be vain, so adding
the '! TREE_THIS_VOLATILE (current_function_decl)' into the

  if (frame_pointer_needed)
    <insert the frame pointer handling stuff>

so it becomes

  if (frame_pointer_needed && ! TREE_THIS_VOLATILE (current_function_decl))
    <insert the frame pointer handling stuff>

in the 'expand the function prologue' code could be suggested too. (if the code
is compiled without '-fomit-frame-pointer', it optimizes a little more)

Cheers, Kai



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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