PATCH for bogus loop optimization

Jeffrey A Law
Wed Sep 30 00:55:00 GMT 1998

  In message < >you write:
  > Because n has its address taken, we turn n's REG into a 
  > MEM (ADDRESSOF (REG)).  Unfortunately, the original REG has
  > REG_USERVAR_P set, while the new REG (embedded in the ADDRESSOF) does
  > not.  Since the address of n is not really needed, we remove the 
  > ADDRESSOF bit after CSE.  That leaves a REG, just as if `n' had not
  > been addressed, but without REG_USERVAR_P set.  That causes scan_loop
  > to assume that there is only one set for n, and that it comes before
  > any use of n, but this is false.  The following patch fixes the bug by
  > making sure that the REG embedded in the ADDRESSOF has REG_USERVAR_P
  > set if the original REG does.
  > Would one of the maintainers care to approve this patch?
  > -- 
  > Mark Mitchell
  > Mark Mitchell Consulting
  > Tue Sep 29 21:27:17 1998  Mark Mitchell  <>
  > 	* function.c (gen_mem_addressof): If the address REG is
  > 	REG_USERVAR_P make the new REG be so also.
  > 	* loop.c (scan_loop): Apply DeMorgan's laws and add documentation
  > 	in an attempt to clarify slightly.
This is fine.  Thanks!


More information about the Gcc-patches mailing list