<div dir="ltr">Sure, none of the cortex-m cores support ARM mode. Try cortex-a{5,7,8,9,15,53} etc and you'll see it works.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 15, 2018 at 5:10 AM, Peter Smith <span dir="ltr"><<a href="mailto:peter.smith@linaro.org" target="_blank">peter.smith@linaro.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My understanding is that whether a gcc toolchain defaults to ARM or<br>
Thumb is a configuration time decision by whomever builds the<br>
toolchain. The linaro arm-linux-gnueabihf toolchain I have defaults to<br>
-mthumb and that doesn't vary for -mcpu or any other command line<br>
option. I haven't got a gcc to hand that defaults to -marm so that I<br>
can test whether -mcpu=cortex-m3 will change that to Thumb. If I try<br>
-marm -mcpu=cortex-m3 I get "error: target CPU does not support ARM<br>
mode".<br>
<br>
Can you give us a more concrete example about where GCC is inconsistent?<br>
<br>
For clang I'm not particularly fond of -Oz implying a change of<br>
instruction set state. I think that it would be difficult to document<br>
properly, especially how to tell clang that I really did mean -Oz on<br>
ARM. As well as being a bit messy to implement.<br>
<br>
I think that most users of clang would prefer to use Thumb(2) than<br>
ARM, although how to make change globally and give people enough<br>
warning could be challenging and we'd need to get a consensus from the<br>
community. I'd also not want to be the person updating all the tests<br>
with -marm.<br>
<br>
The reset vectors on some old architectures did need to be ARM state,<br>
although I think they had to be written in assembly. It is possible<br>
though that someone is using clang as the assembler driver and we'd<br>
pass through -mthumb when they weren't expecting it.<br>
<span class="HOEnZb"><font color="#888888"><br>
Peter<br>
</font></span><div class="HOEnZb"><div class="h5">On Thu, 15 Nov 2018 at 12:39, Tim Northover via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br>
><br>
> On Thu, 15 Nov 2018 at 12:25, Bruce Hoult <<a href="mailto:brucehoult@sifive.com">brucehoult@sifive.com</a>> wrote:<br>
> > OK, I just checked, and -mcpu=cortex-{m3,m4,m7,a7,a9,<wbr>a15,a53} gives Thumb at -O1, -O1, -Os on the following gcc:<br>
><br>
> If anything I'd be inclined to just default to Thumb always. I haven't<br>
> checked myself, but rumour has it the icache benefits make it faster<br>
> than ARM code as well as smaller in most cases. My one worry there is<br>
> with reset vectors, which I believe must be implemented in ARM in some<br>
> cases; but since GCC itself appears to be inconsistent here, hopefully<br>
> those people are already explicit about their needs.<br>
><br>
> Cheers.<br>
><br>
> Tim.<br>
</div></div><div class="HOEnZb"><div class="h5">> ______________________________<wbr>_________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>