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


>>>>> "Laurent" == Laurent Guerby <guerby@acm.org> writes:

    Laurent> 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.

    Laurent> Will there be a documented way to generate an empty loop
    Laurent> that survives optimization then? I can think of using a
    Laurent> volatile variable, but this generates unecessary memory
    Laurent> accesses.

The usual use for such a thing is a timing loop on an embedded system.
In that case, you already need intimate knoweldge of the processor.
You can write the loop as a volatile asm, and the optimizer will leave
it alone.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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