This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: [PATCH 2/3] arm: Remove optpld macro


On 01/12/2017 09:56 AM, Corinna Vinschen wrote:
On Jan 11 23:50, Pat Pannuto wrote:
LTO can re-order top-level assembly blocks, which can cause this
macro definition to appear after its use (or not at all), causing
compilation failures. As the macro has very few uses, simply removing
it by inlining is a simple fix.
Am I the only one thinking this is a compiler bug, rather than correct
behaviour?

The macro definition is not an assembly block as such, but rather just
that: a macro definition which is supposed to be evaluated at compile
(or assemble) time.  To reorder it on the source level seems completely
out of the scope of LTO.

Am I missing something or should this be fixed in GCC?


Corinna

I was asking the same question, so you are not the only one. (I'm also confused because the patch is talking about link-time optimization, not compilation. But Pat says it causes a compilation failure. So then how is this related to LTO, even?)

In addition, I have another question/issue. Sure, it is easy to modify the Newlib code, itself, to avoid this macro, but how can we know that there is not any user code which uses it that would now fail when it has been removed? This is a higher-level include file that users might have used; it is not a lower-level, newlib-internal file, it does not seem. That is, is it OK for compatibility reasons to just remove it (especially without a note as to why it is dangerous)?

Craig


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