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]

Re: SSA-based dead-code elimination


On Wed, Aug 02, 2000 at 11:31:48PM +0200, Laurent Guerby wrote:
> Mark Mitchell wrote [about empty loops removal]:
> > So, I think we should reserve your patch for the day when we actually
> > turn this stuff on by default.
> 
> Will there be a documented way to generate an empty loop that survives
> optimization then? I can think of using a volatile variable, but this
> generates unecessary memory accesses.

One such way would be to us an empty asm (which given it doesn't specify target
and input arguments, should be treated as volatile):

	int i;

	for (i = 0; i < n; i++)
	  __asm__ ("");

-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482

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