On Tue, 4 Jun 2019, Feng Xue OS wrote:
I think we should turn this option on by default, document that and note
that some languages (C++) say loops terminate.
To enable this option at -O2 is not very suitable, seems to be more aggressive.
Better to turn it on at -O3.
Why wouldn't it be suitable for -O2? Normally, not suitable for -O2 could
be because it is expensive (in compile time), because it increases the
code size a lot, because it doesn't always actually improve the running
time, etc. I don't see any of that here. There isn't supposed to be a
semantic difference between -O2 and -O3. Do you consider it "dangerous" in
a similar sense as -fstrict-aliasing? We enable that by default at -O2.
--
Marc Glisse