This is the mail archive of the gcc@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]

PR65416, alloca on xtensa


Hi Sterling,

I've got an issue building gdb for xtensa linux with gcc, reported it here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65416

Looking at it I've got two questions, can you help me with them?

1. in windowed ABI stack pointer update is always split into two opcodes:
  add and movsp. How gcc optimization passes are supposed to know that
  'movsp' is related to 'add' and that stack allocation is complete only after
  movsp?

2. alloca seems to make an additional 16-bytes padding to each stack
  allocation: alloca(1) results in moving sp down by 32 bytes, alloca(17)
  moves it by 48 bytes, etc. This padding looks unnecessary to me: either
  this space is not used (previous register frame is not spilled), or alloca
  exception handler will take care about reloading or moving spilled registers
  to a new location. In both cases after movsp this space is just wasted.
  Do you know why this padding may be needed?

-- 
Thanks.
-- Max


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