public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PING][PATCH, GCC/ARM] Only test tls-disable-literal-pool.c if target supports native TLS
@ 2017-05-19 12:33 Prakhar Bahuguna
  2017-05-19 12:51 ` Kyrill Tkachov
  2017-05-29 12:56 ` Christophe Lyon
  0 siblings, 2 replies; 6+ messages in thread
From: Prakhar Bahuguna @ 2017-05-19 12:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd, Richard.Earnshaw, Ramana.Radhakrishnan, Kyrylo.Tkachov

On 11/05/2017 14:54:37, Prakhar Bahuguna wrote:
> tls-disable-literal-pool.c should only be run if the toolchain and target
> support native thread-local storage rather than emulated TLS. This patch also
> improves the matching of the error message.
> 
> testsuite/ChangeLog:
> 
> 2017-05-11  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>
> 
> 	* gcc.target/arm/tls-disable-literal-pool.c: Change
> 	require-effective-target to tls_native.
> 	Move dg-error to return statement line and change to dg-message.
> 
> Testing done: Regression testing for ARMv7-M with a TLS-enabled toolchain and a
> TLS-disabled toolchain.
> 
> Okay for stage1?
> 
> -- 
> 
> Prakhar Bahuguna

> From 84837978d480a1abcebe7b4d2ac21af0eb6645b4 Mon Sep 17 00:00:00 2001
> From: Prakhar Bahuguna <prakhar.bahuguna@arm.com>
> Date: Thu, 11 May 2017 13:24:39 +0100
> Subject: [PATCH] Only test tls-disable-literal-pool.c if target supports
>  native TLS
> 
> This test should only be run if the toolchain and target support native
> thread-local storage rather than emulated TLS.
> ---
>  gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c b/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c
> index fe14a6b132c..283201fdd97 100644
> --- a/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c
> +++ b/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-require-effective-target tls } */
> +/* { dg-require-effective-target tls_native } */
>  /* { dg-require-effective-target arm_cortex_m } */
>  /* { dg-require-effective-target arm_thumb2_ok } */
>  /* { dg-options "-mslow-flash-data" } */
> @@ -9,7 +9,6 @@ __thread int x = 0;
>  int
>  bar ()
>  {
> -  return x;
> +  return x; /* { dg-message "sorry, unimplemented: accessing thread-local storage is not currently supported with -mpure-code or -mslow-flash-data" } */
>  }
>  
> -/* { dg-error "accessing thread-local storage is not currently supported with -mpure-code or -mslow-flash-data" "" { target *-*-* } 12 } */
> -- 
> 2.11.0
> 

Ping.

-- 

Prakhar Bahuguna

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PING][PATCH, GCC/ARM] Only test tls-disable-literal-pool.c if target supports native TLS
  2017-05-19 12:33 [PING][PATCH, GCC/ARM] Only test tls-disable-literal-pool.c if target supports native TLS Prakhar Bahuguna
@ 2017-05-19 12:51 ` Kyrill Tkachov
  2017-05-29 12:56 ` Christophe Lyon
  1 sibling, 0 replies; 6+ messages in thread
From: Kyrill Tkachov @ 2017-05-19 12:51 UTC (permalink / raw)
  To: Prakhar Bahuguna, gcc-patches; +Cc: Richard.Earnshaw, Ramana.Radhakrishnan

Hi Prakhar,

On 19/05/17 13:29, Prakhar Bahuguna wrote:
> On 11/05/2017 14:54:37, Prakhar Bahuguna wrote:
>> tls-disable-literal-pool.c should only be run if the toolchain and target
>> support native thread-local storage rather than emulated TLS. This patch also
>> improves the matching of the error message.
>>
>> testsuite/ChangeLog:
>>
>> 2017-05-11  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>
>>
>> 	* gcc.target/arm/tls-disable-literal-pool.c: Change
>> 	require-effective-target to tls_native.
>> 	Move dg-error to return statement line and change to dg-message.
>>
>> Testing done: Regression testing for ARMv7-M with a TLS-enabled toolchain and a
>> TLS-disabled toolchain.
>>
>> Okay for stage1?

Ok.
Thanks,
Kyrill

>>
>> -- 
>>
>> Prakhar Bahuguna
>>  From 84837978d480a1abcebe7b4d2ac21af0eb6645b4 Mon Sep 17 00:00:00 2001
>> From: Prakhar Bahuguna <prakhar.bahuguna@arm.com>
>> Date: Thu, 11 May 2017 13:24:39 +0100
>> Subject: [PATCH] Only test tls-disable-literal-pool.c if target supports
>>   native TLS
>>
>> This test should only be run if the toolchain and target support native
>> thread-local storage rather than emulated TLS.
>> ---
>>   gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c | 5 ++---
>>   1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c b/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c
>> index fe14a6b132c..283201fdd97 100644
>> --- a/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c
>> +++ b/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c
>> @@ -1,5 +1,5 @@
>>   /* { dg-do compile } */
>> -/* { dg-require-effective-target tls } */
>> +/* { dg-require-effective-target tls_native } */
>>   /* { dg-require-effective-target arm_cortex_m } */
>>   /* { dg-require-effective-target arm_thumb2_ok } */
>>   /* { dg-options "-mslow-flash-data" } */
>> @@ -9,7 +9,6 @@ __thread int x = 0;
>>   int
>>   bar ()
>>   {
>> -  return x;
>> +  return x; /* { dg-message "sorry, unimplemented: accessing thread-local storage is not currently supported with -mpure-code or -mslow-flash-data" } */
>>   }
>>   
>> -/* { dg-error "accessing thread-local storage is not currently supported with -mpure-code or -mslow-flash-data" "" { target *-*-* } 12 } */
>> -- 
>> 2.11.0
>>
> Ping.
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PING][PATCH, GCC/ARM] Only test tls-disable-literal-pool.c if target supports native TLS
  2017-05-19 12:33 [PING][PATCH, GCC/ARM] Only test tls-disable-literal-pool.c if target supports native TLS Prakhar Bahuguna
  2017-05-19 12:51 ` Kyrill Tkachov
@ 2017-05-29 12:56 ` Christophe Lyon
  2017-05-30  7:47   ` Prakhar Bahuguna
  1 sibling, 1 reply; 6+ messages in thread
From: Christophe Lyon @ 2017-05-29 12:56 UTC (permalink / raw)
  To: Prakhar Bahuguna
  Cc: gcc-patches, nd, Richard Earnshaw, Ramana Radhakrishnan, Kyrylo Tkachov

On 19 May 2017 at 14:29, Prakhar Bahuguna <prakhar.bahuguna@arm.com> wrote:
> On 11/05/2017 14:54:37, Prakhar Bahuguna wrote:
>> tls-disable-literal-pool.c should only be run if the toolchain and target
>> support native thread-local storage rather than emulated TLS. This patch also
>> improves the matching of the error message.
>>
>> testsuite/ChangeLog:
>>
>> 2017-05-11  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>
>>
>>       * gcc.target/arm/tls-disable-literal-pool.c: Change
>>       require-effective-target to tls_native.
>>       Move dg-error to return statement line and change to dg-message.
>>
>> Testing done: Regression testing for ARMv7-M with a TLS-enabled toolchain and a
>> TLS-disabled toolchain.
>>

Hi,
Can you share more details on the configuration you used?
In my testing, the only cortex-M config I have is arm-none-eabi
--with-cpu=cortex-m3.
Since arm-none-eabi means native-tls is disabled, this test is skipped.
A constraint for me is that m3 was the only cortex-m cpu supported by qemu the
last time I checked.

Thanks,

Christophe

>> Okay for stage1?
>>
>> --
>>
>> Prakhar Bahuguna
>
>> From 84837978d480a1abcebe7b4d2ac21af0eb6645b4 Mon Sep 17 00:00:00 2001
>> From: Prakhar Bahuguna <prakhar.bahuguna@arm.com>
>> Date: Thu, 11 May 2017 13:24:39 +0100
>> Subject: [PATCH] Only test tls-disable-literal-pool.c if target supports
>>  native TLS
>>
>> This test should only be run if the toolchain and target support native
>> thread-local storage rather than emulated TLS.
>> ---
>>  gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c b/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c
>> index fe14a6b132c..283201fdd97 100644
>> --- a/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c
>> +++ b/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c
>> @@ -1,5 +1,5 @@
>>  /* { dg-do compile } */
>> -/* { dg-require-effective-target tls } */
>> +/* { dg-require-effective-target tls_native } */
>>  /* { dg-require-effective-target arm_cortex_m } */
>>  /* { dg-require-effective-target arm_thumb2_ok } */
>>  /* { dg-options "-mslow-flash-data" } */
>> @@ -9,7 +9,6 @@ __thread int x = 0;
>>  int
>>  bar ()
>>  {
>> -  return x;
>> +  return x; /* { dg-message "sorry, unimplemented: accessing thread-local storage is not currently supported with -mpure-code or -mslow-flash-data" } */
>>  }
>>
>> -/* { dg-error "accessing thread-local storage is not currently supported with -mpure-code or -mslow-flash-data" "" { target *-*-* } 12 } */
>> --
>> 2.11.0
>>
>
> Ping.
>
> --
>
> Prakhar Bahuguna

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PING][PATCH, GCC/ARM] Only test tls-disable-literal-pool.c if target supports native TLS
  2017-05-29 12:56 ` Christophe Lyon
@ 2017-05-30  7:47   ` Prakhar Bahuguna
  2017-05-30 12:12     ` Christophe Lyon
  0 siblings, 1 reply; 6+ messages in thread
From: Prakhar Bahuguna @ 2017-05-30  7:47 UTC (permalink / raw)
  To: Christophe Lyon; +Cc: gcc-patches, nd

On 29/05/2017 14:23:05, Christophe Lyon wrote:
> On 19 May 2017 at 14:29, Prakhar Bahuguna <prakhar.bahuguna@arm.com> wrote:
> > On 11/05/2017 14:54:37, Prakhar Bahuguna wrote:
> >> tls-disable-literal-pool.c should only be run if the toolchain and target
> >> support native thread-local storage rather than emulated TLS. This patch also
> >> improves the matching of the error message.
> >>
> >> testsuite/ChangeLog:
> >>
> >> 2017-05-11  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>
> >>
> >>       * gcc.target/arm/tls-disable-literal-pool.c: Change
> >>       require-effective-target to tls_native.
> >>       Move dg-error to return statement line and change to dg-message.
> >>
> >> Testing done: Regression testing for ARMv7-M with a TLS-enabled toolchain and a
> >> TLS-disabled toolchain.
> >>
> 
> Hi,
> Can you share more details on the configuration you used?
> In my testing, the only cortex-M config I have is arm-none-eabi
> --with-cpu=cortex-m3.
> Since arm-none-eabi means native-tls is disabled, this test is skipped.
> A constraint for me is that m3 was the only cortex-m cpu supported by qemu the
> last time I checked.
> 
> Thanks,
> 
> Christophe
> 

Hi Christophe,

For a regular arm-none-eabi build, TLS is indeed disabled and the test should
be skipped. The diagnostic and test is meant to catch instances where the
toolchain has been built with native TLS enabled. This can be done either by
explicitly passing the --enable-tls configure flag for arm-none-eabi, or by
using an arm-none-linux-gnueabi[hf] toolchain and testing against an M-profile
target.

Hope this helps,

-- 

Prakhar Bahuguna

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PING][PATCH, GCC/ARM] Only test tls-disable-literal-pool.c if target supports native TLS
  2017-05-30  7:47   ` Prakhar Bahuguna
@ 2017-05-30 12:12     ` Christophe Lyon
  2017-05-30 12:29       ` Prakhar Bahuguna
  0 siblings, 1 reply; 6+ messages in thread
From: Christophe Lyon @ 2017-05-30 12:12 UTC (permalink / raw)
  To: Prakhar Bahuguna; +Cc: gcc-patches, nd

On 30 May 2017 at 09:44, Prakhar Bahuguna <prakhar.bahuguna@arm.com> wrote:
> On 29/05/2017 14:23:05, Christophe Lyon wrote:
>> On 19 May 2017 at 14:29, Prakhar Bahuguna <prakhar.bahuguna@arm.com> wrote:
>> > On 11/05/2017 14:54:37, Prakhar Bahuguna wrote:
>> >> tls-disable-literal-pool.c should only be run if the toolchain and target
>> >> support native thread-local storage rather than emulated TLS. This patch also
>> >> improves the matching of the error message.
>> >>
>> >> testsuite/ChangeLog:
>> >>
>> >> 2017-05-11  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>
>> >>
>> >>       * gcc.target/arm/tls-disable-literal-pool.c: Change
>> >>       require-effective-target to tls_native.
>> >>       Move dg-error to return statement line and change to dg-message.
>> >>
>> >> Testing done: Regression testing for ARMv7-M with a TLS-enabled toolchain and a
>> >> TLS-disabled toolchain.
>> >>
>>
>> Hi,
>> Can you share more details on the configuration you used?
>> In my testing, the only cortex-M config I have is arm-none-eabi
>> --with-cpu=cortex-m3.
>> Since arm-none-eabi means native-tls is disabled, this test is skipped.
>> A constraint for me is that m3 was the only cortex-m cpu supported by qemu the
>> last time I checked.
>>
>> Thanks,
>>
>> Christophe
>>
>
> Hi Christophe,
>
> For a regular arm-none-eabi build, TLS is indeed disabled and the test should
> be skipped. The diagnostic and test is meant to catch instances where the
> toolchain has been built with native TLS enabled. This can be done either by
> explicitly passing the --enable-tls configure flag for arm-none-eabi, or by

This didn't occur to me: what does --target arm-none-eabi --enable-tls actually
means in terms of functionality? Do you use newlib +  a suitable kernel to
provide thread support? Or are all the tls-related GCC tests compile-only,
and we do not need a setup with proper thread support to actually test this?

> using an arm-none-linux-gnueabi[hf] toolchain and testing against an M-profile
> target.
I guess you use a board for that? As I'm using qemu (user mode) for GCC testing,
I'm not sure how I could test such a configuration given that qemu
does not support
any v7m processor to my knowledge.


> Hope this helps,

Yes, thanks.

> --
>
> Prakhar Bahuguna

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PING][PATCH, GCC/ARM] Only test tls-disable-literal-pool.c if target supports native TLS
  2017-05-30 12:12     ` Christophe Lyon
@ 2017-05-30 12:29       ` Prakhar Bahuguna
  0 siblings, 0 replies; 6+ messages in thread
From: Prakhar Bahuguna @ 2017-05-30 12:29 UTC (permalink / raw)
  To: Christophe Lyon; +Cc: gcc-patches, nd

On 30/05/2017 14:11:22, Christophe Lyon wrote:
> On 30 May 2017 at 09:44, Prakhar Bahuguna <prakhar.bahuguna@arm.com> wrote:
> > On 29/05/2017 14:23:05, Christophe Lyon wrote:
> >> On 19 May 2017 at 14:29, Prakhar Bahuguna <prakhar.bahuguna@arm.com> wrote:
> >> > On 11/05/2017 14:54:37, Prakhar Bahuguna wrote:
> >> >> tls-disable-literal-pool.c should only be run if the toolchain and target
> >> >> support native thread-local storage rather than emulated TLS. This patch also
> >> >> improves the matching of the error message.
> >> >>
> >> >> testsuite/ChangeLog:
> >> >>
> >> >> 2017-05-11  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>
> >> >>
> >> >>       * gcc.target/arm/tls-disable-literal-pool.c: Change
> >> >>       require-effective-target to tls_native.
> >> >>       Move dg-error to return statement line and change to dg-message.
> >> >>
> >> >> Testing done: Regression testing for ARMv7-M with a TLS-enabled toolchain and a
> >> >> TLS-disabled toolchain.
> >> >>
> >>
> >> Hi,
> >> Can you share more details on the configuration you used?
> >> In my testing, the only cortex-M config I have is arm-none-eabi
> >> --with-cpu=cortex-m3.
> >> Since arm-none-eabi means native-tls is disabled, this test is skipped.
> >> A constraint for me is that m3 was the only cortex-m cpu supported by qemu the
> >> last time I checked.
> >>
> >> Thanks,
> >>
> >> Christophe
> >>
> >
> > Hi Christophe,
> >
> > For a regular arm-none-eabi build, TLS is indeed disabled and the test should
> > be skipped. The diagnostic and test is meant to catch instances where the
> > toolchain has been built with native TLS enabled. This can be done either by
> > explicitly passing the --enable-tls configure flag for arm-none-eabi, or by
> 
> This didn't occur to me: what does --target arm-none-eabi --enable-tls actually
> means in terms of functionality? Do you use newlib +  a suitable kernel to
> provide thread support? Or are all the tls-related GCC tests compile-only,
> and we do not need a setup with proper thread support to actually test this?
> 

Hi Christophe, the test is compile-only. Threading isn't really a thing in the
context of bare-metal code on a microcontroller, but this diagnostic is there
to prevent the compiler from generating garbage assembly even if the user is
going out of their way to do something nonsensical. The test exists to validate
that the diagnostic triggers under such conditions.

> > using an arm-none-linux-gnueabi[hf] toolchain and testing against an M-profile
> > target.
> I guess you use a board for that? As I'm using qemu (user mode) for GCC testing,
> I'm not sure how I could test such a configuration given that qemu
> does not support
> any v7m processor to my knowledge.

As above, the execution target does not matter as there is no code to execute.
The compiler should simply error out if told to compile code with thread-local
variables and literal pools disabled.

-- 

Prakhar Bahuguna

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-30 12:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 12:33 [PING][PATCH, GCC/ARM] Only test tls-disable-literal-pool.c if target supports native TLS Prakhar Bahuguna
2017-05-19 12:51 ` Kyrill Tkachov
2017-05-29 12:56 ` Christophe Lyon
2017-05-30  7:47   ` Prakhar Bahuguna
2017-05-30 12:12     ` Christophe Lyon
2017-05-30 12:29       ` Prakhar Bahuguna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).