This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Empty loops removal (Was Re: Some extra decorations)


Jonathan Wakely:
2009/5/4 Joseph S. Myers:
> On Mon, 4 May 2009, Jan Hubicka wrote:
>
>> On mainline I enabled infinite loop removal at
>> -funsafe-loop-optimizations. I would suggest adding
>> -fempty-loops-terminate and make it default for C++? It does not apply
>> for C, right?
>
> You mean for C++0x (I see no such rule in C++03), and there is no such
> rule for C at present.

Yes, the rule is new for C++0x, and it is in the context of for, while
and do-while loops only, not recursive calls.

It might be worth raising this issue on c++std-core, because it's easy for a compiler to transform recursion to a loop using tail call elimination, and I suspect that it is in line with the original intent to treat recursion with no side effects as finite in the same way.



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