On 12/02/2021 17:21, Christophe Lyon wrote:
> On Fri, 12 Feb 2021 at 17:02, Richard Earnshaw
> <richard.earns...@foss.arm.com> wrote:
>>
>> On 12/02/2021 14:20, Christophe Lyon via Gcc-patches wrote:
>>> This test forces -march=armv8.1-m.main, which supports only Thumb mode.
>>> However, if the toolchain is not configured --with-thumb, the test
>>> fails with:
>>> error: target CPU does not support ARM mode
>>>
>>> Adding -mthumb to dg-options fixes the problem.
>>>
>>
>> Hmm, this sounds like a different problem.  The driver, these days, is
>> supposed to detect when the architecture only supports thumb and to add
>> that automatically when calling cc1 etc.  So why isn't that working in
>> this case?
>>
>> (See gcc/common/config/arm/arm-common.c:arm_target_thumb_only).
>>
> 
> Well, I've just rebuilt --with-mode=arm --with-cpu=cortex-a9
> --target=arm-none-eabi
> and when I compile
> $ arm-none-eabi-gcc hello.c -march=armv8.1-m.main -S
> cc1: error: target CPU does not support ARM mode
> I put a breakpoint in arm_target_thumb_only and it did not trigger.

Ah, I think it must be the "--with-mode=arm" that causes this.  That
must be added before the driver self specs are analysed.

R.

> 
> 
>> R.
>>
>>> Committed as obvious.
>>>
>>> 2021-02-12  Christophe Lyon  <christophe.l...@linaro.org>
>>>
>>>       PR target/98931
>>>       gcc/testsuite/
>>>       * gcc.target/arm/pr98931.c: Add -mthumb
>>> ---
>>>  gcc/testsuite/gcc.target/arm/pr98931.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/gcc/testsuite/gcc.target/arm/pr98931.c 
>>> b/gcc/testsuite/gcc.target/arm/pr98931.c
>>> index 313876a..66070ad 100644
>>> --- a/gcc/testsuite/gcc.target/arm/pr98931.c
>>> +++ b/gcc/testsuite/gcc.target/arm/pr98931.c
>>> @@ -1,6 +1,6 @@
>>>  /* { dg-do assemble } */
>>>  /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" 
>>> "-mcpu=*" } } */
>>> -/* { dg-options "-march=armv8.1-m.main -O3 
>>> --param=max-completely-peeled-insns=1300 --save-temps" } */
>>> +/* { dg-options "-march=armv8.1-m.main -O3 
>>> --param=max-completely-peeled-insns=1300 --save-temps -mthumb" } */
>>>
>>>  extern long long a[][20][26][26][22];
>>>
>>>
>>

Reply via email to