Sjoerd Meijer via llvm-dev
2018-Nov-15 11:49 UTC
[llvm-dev] [RFC][ARM] -Oz implies -mthumb
Hello, I would like to address an issue/inconsistency related to command line options and compiling for minimum code size, and wanted to check if there would be any problems or objections to my change. The problem is that compiling for minimum code size like this: -Oz --target=arm-arm--eabi -mcpu=cortex-xyz does not really give minimum code size because -mthumb is not enabled. This looks like a sub-optimal user experience to me, and also, it is inconsistent with GCC's behaviour. In other words: for AArch32, optimisation level -Oz targets A32, but I would like to change that to T32, and so I would like to propose that -Oz implies -mthumb. Cheers, Sjoerd. IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181115/20240f91/attachment.html>
Tim Northover via llvm-dev
2018-Nov-15 12:14 UTC
[llvm-dev] [cfe-dev] [RFC][ARM] -Oz implies -mthumb
Hi Sjoerd, On Thu, 15 Nov 2018 at 11:49, Sjoerd Meijer via cfe-dev <cfe-dev at lists.llvm.org> wrote:> does not really give minimum code size because -mthumb is not enabled. This looks like a sub-optimal user experience to me, and also, it is inconsistent with GCC's behaviour.Which version? None of the GCCs on Godbolt exhibit the kind of switching you're describing as far as I can tell. Cheers. Tim.
Bruce Hoult via llvm-dev
2018-Nov-15 12:25 UTC
[llvm-dev] [cfe-dev] [RFC][ARM] -Oz implies -mthumb
I've never tried -mcpu=cortex-xyz but I know -march=armv7 defaults to Thumb OK, I just checked, and -mcpu=cortex-{m3,m4,m7,a7,a9,a15,a53} gives Thumb at -O1, -O1, -Os on the following gcc: arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04) 7.3.0 cortex-m0 fails because it doesn't do hard float. I don't have an eabi compiler around. On Thu, Nov 15, 2018 at 4:14 AM, Tim Northover via cfe-dev < cfe-dev at lists.llvm.org> wrote:> Hi Sjoerd, > > On Thu, 15 Nov 2018 at 11:49, Sjoerd Meijer via cfe-dev > <cfe-dev at lists.llvm.org> wrote: > > does not really give minimum code size because -mthumb is not enabled. > This looks like a sub-optimal user experience to me, and also, it is > inconsistent with GCC's behaviour. > > Which version? None of the GCCs on Godbolt exhibit the kind of > switching you're describing as far as I can tell. > > Cheers. > > Tim. > _______________________________________________ > cfe-dev mailing list > cfe-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181115/17708337/attachment.html>