Gary Thomas: Code optimization bug in GCC-2.8 & EGCS

Jeffrey A Law law@cygnus.com
Fri Jan 30 10:13:00 GMT 1998


  In message < 9801301629.AA31568@rios1.watson.ibm.com >you write:
  > 	duplicate_loop_exit_text() in jump.c searches the exit test code
  > to potentially duplicate it but limits the number of instructions to 20,
  > from the comments:
  > 
  > 	If the code is sufficiently simple, make a copy of it before INSN
  > 	Also, don't do this if the exit code is more than 20 insns.
  > 
  > I do not know how this heuristic was determined, but it seems to be
  > incorrect for some PowerPC cases.  Gary's appended patch increases the
  > value to 50 which fixes the particular example.
[ ... ]
  > I am not sure why *any* value for the search is
  > appropriate -- especially on all architectures.
It looks like someone just had to pick a number of instruction to
stop the search.  It could be the case that this code pre-dates
many of the machine dependent macros we've got for tuning purposes.
I don't really know.


  > From his explanation, it
  > sounds like CSE reorganizes the code incorrectly and this patch simply
  > masks that problem.
Agreed.

jeff



More information about the Gcc mailing list