gcc 2.92.2: bad code generation from tail-call optimization (x86)

Jeffrey A Law law@cygnus.com
Tue Mar 28 10:37:00 GMT 2000


  In message <14443.40523.991206.668791@spleen.hq.tensilica.com>you write:
  > 
  > The included function, when compiled with gcc 2.95.2 generates bad code for
  > x86 because of an incorrectly applied tail-call optimization. The function
  > takes the address of an automatic, and thus should not be a candidate for
  > tail-calls. The source and assembly code are commented to show the location
  > of the incorrect tail-call.
  > 
  > We took a quick look into the possible cause, and it appears that the
  > function that implements the optimization in stmt.c:optimize_tail_resursion
  > is using 'frame_offset' before it is calculated.
  > 
  > BTW, egcs-2.91.66 fails in the same way.
I believe this has been fixed in the development sources.
jeff



More information about the Gcc-bugs mailing list