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: unwind info for epilogues


Jakub Jelinek wrote:
(I believe at least the removal of .cfi_restore because of red-zone
is something that is difficult to do in the middle-end, since it doesn't
know anything about red-zone).

Possibly, though it wouldn't be that hard to teach the middle-end about a red-zone. I think this approach is certainly useful in the short-term before a middle-end pass exists.

+  /* Calculate start of saved registers relative to esp on entry of the
+     function.  When realigning stack, this needs to be smallest possible
+     value at runtime.  */
+  red_offset = offset;
+  if (using_drap)
+    red_offset -= crtl->stack_alignment_needed / BITS_PER_UNIT
+		  + UNITS_PER_WORD;
+  if (frame_pointer_needed)
+    red_offset -= UNITS_PER_WORD;
+  if (stack_realign_fp)
+    red_offset -= crtl->stack_alignment_needed / BITS_PER_UNIT
+		  - UNITS_PER_WORD;

Only one of USING_DRAP or STACK_REALIGN_FP, surely? Also, I think "smallest" is misleading, since it implies (to me) smallest absolute value, whereas what I think you mean is "most negative" or "largest".


r~



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