[cfe-dev] [ARM][AArch64] Default to -fno-common

Tom Stellard via cfe-dev cfe-dev at lists.llvm.org
Mon Feb 24 08:31:04 PST 2020


On 02/24/2020 08:28 AM, Sjoerd Meijer via cfe-dev wrote:
> Hello,
> 
> Subject says most of it: I would like to propose that the Arm targets default to -fno-common for performance and code-size reasons. In addition, GCC has also flipped the switch recently, see [1], so we would get the same behaviour as GCC which would also be nice. I've learned that the switch for GCC was relatively straightforward (for users), and there is some GNU documentation with Q&As to help toolchain users to transition if they find problems. I have put a draft patch up for review here: https://reviews.llvm.org/D75056. This definitely needs some doc changes (and I need to look at the tests), but first I would like to see how we feel about flipping the switch: any ideas, comments, objections?
> 

Is there any reason to limit this to just the ARM targets?

-Tom

> Cheers,
> Sjoerd.
> 
> 
> [1] The GCC commit:
> 
> commit 6271dd984d7f920d4fb17ad37af6a1f8e6b796dc
> Author: Wilco Dijkstra <wdijkstr at arm.com>
> Date:   Wed Nov 20 16:29:23 2019 +0000
> 
>     PR85678: Change default to -fno-common
>     GCC currently defaults to -fcommon.  As discussed in the PR, this is an ancient
>     C feature which is not conforming with the latest C standards.  On many targets
>     this means global variable accesses have a codesize and performance penalty.
>     This applies to C code only, C++ code is not affected by -fcommon.  It is about
>     time to change the default.
> 
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
> 



More information about the cfe-dev mailing list