patch to improve i386 epilogue (version 2)

John Wehle
Mon Sep 28 23:06:00 GMT 1998

> Thinking this through a little, it also occurs to me that you might
> just be able to look at whether or not the stack pointer is live at
> entry to the last basic block.
> In fact, that might be the best solution.  The nice thing is it keeps
> flow.c and the epilogue code in sync (which is very important from a
> correctness standpoint).

Currently the stack pointer isn't marked as alive (though the frame pointer
is) at entry to any basic blocks when compiling a leaf function on the i386
unless -fomit-frame-pointer is being used in which case all this is moot.
At least that's what I see from the rtl dump after flow has run when using
-da -S -O to compile:

subr1(int a, int b)
  int c;
  int d;
  int e;
  int f;
  int g;
  int i;

  c = a;
  d = b;
  g = 0;

  for (i = c; i < d; i++) {
    e = c / d;
    f = c % d;
    c = e;
    d = f;
    g += c - d;

  if (g != g)
    printf("g != g\n");
    for ( ; ; )
      printf("g != g\n");

  return g;

I'll probably just submit a new patch based on checking for function calls
during life analysis (as was discussed previously).

-- John
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email:  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |

More information about the Gcc-patches mailing list