This is the mail archive of the 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: -funsafe-loop-optimizations

Paul Schlie wrote:

I suspect we're not referring to the same thread of context; I made the
comment in response to:
which I didn't interpret as referring to the portability of the compiler,
but rather code compiled by it having potentially different semantics as
a function of the "target's" type-sizes,

That's not a compiler issue, the author was simply pointing out that code of the type we are talking about is inherently non-portable. If you have a loop that is infinite if the size of unsigned is 16 and well behaved if the size of unsigned is 32, as required by the standard, then you have simply written non-portable code. This is nothing to do with the compiler. Indeed if anything the improper "optimization" might have the effect of increasing portability in practice of this incorrect code. What MK was noting was that even though this code is non-portable, in practice, it may be portable to 32-bit architectures. That's nothing new, and nothing to do with the code that gcc generates. C is a language where it is very easy to write non- portable code if you are not very careful. The compiler cannot somehow magically correct such programs.

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