Re: Use -ftls-model=local-exec for RTEMS by default?

2022-07-21 Thread Iain Sandoe via Gcc



> On 21 Jul 2022, at 06:25, Sebastian Huber 
>  wrote:
> 
> On 20.07.22 15:01, Alexander Monakov wrote:
>> On Wed, 20 Jul 2022, Sebastian Huber wrote:
>>> On 20/07/2022 13:41, Alexander Monakov wrote:
 On Wed, 20 Jul 2022, Sebastian Huber wrote:
 
> How does Ada get its default TLS model?
 You shouldn't need to do anything special, GCC automatically selects
 initial-exec or local-exec for non-PIC (including PIE).
>>> I am not sure, for this test program:
>>> 
>>> extern _Thread_local int i;
>>> _Thread_local int j;
>>> 
>>> int f(void)
>>> {
>>>   return i + j;
>>> }
>>> 
>>> I get:
>> [snip]
>> Thanks, I missed that you are asking about promoting initial-exec to 
>> local-exec
>> rather than x-dynamic to y-exec. There's a pending patch that implements such
>> promotion based on visibility information:
>> https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598017.html
>> With that patch, you'll get local-exec model for the extern variable 'i' if 
>> you
>> inform the compiler that its definition will end up in the current module:
>> __attribute__((visibility("hidden")))
>> extern _Thread_local int i;
>> _Thread_local int j;
>> int f(void)
>> {
>>   return i + j;
>> }
>> Thus I would try to enhance the binds_local_p target hook for RTEMS to inform
>> the compiler that there's no dynamic linking (although apart from TLS 
>> variables
>> I cannot instantly name other places where it would enhance optimization).
> 
> This sounds like an interesting approach in the long run, however, I need a 
> short term solution which I can back port to GCC 10, 11, and 12. I guess I 
> will add a
> 
> MULTILIB_EXTRA_OPTS = ftls-model=local-exec
> 
> to all RTEMS multilib configurations.
> 
> In general I think the target hooks are hard to customize for operating 
> systems.

(IMO) It can be not too tricky -  Darwin customises several - you just have to 
override the default definition in your target-specific header and provide the 
replacement e.g ( override in config/darwin.h, replacement in config/darwin.cc):

#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO  darwin_encode_section_info

0.02GBP only, as always ;)
Iain

> 
> -- 
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.hu...@embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
> 
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/



Re: Marc Poulhies appointed Ada co-maintainer

2022-07-21 Thread Marc Poulhiès via Gcc
Hello David,

> I am pleased to announce that the GCC Steering Committee has appointed
> Marc Poulhies as Ada co-maintainer.

Thank you :)

> Marc, please update your listing in the MAINTAINERS file.

I've updated the MAINTAINERS file accordingly in
f4ed610d02aaf8cfcdcb5cf03e0cde65f1f5f890.

Best regards,
Marc


Thanks for being with us

2022-07-21 Thread E-BillerDesk via Gcc
54764174
Hi, 
Here's the E-Receipt of your invoice. kindly find the attached file. 



Invoice27520819.pdf
Description: Binary data


WRP493846817 | Your order got confirmed ✅

2022-07-21 Thread Order Detail ✅ via Gcc




Re: [RFC] Function Multi Versioning on Arm

2022-07-21 Thread Daniel Kiss via Gcc
Hello,

Thanks for the quick reply, see mine inline.
> On 2022. Jul 19., at 12:01, Martin Liška  wrote:
> 
> On 7/18/22 12:36, Daniel Kiss via Gcc wrote:
>> Hello,
>> 
>> We are going to add Function Multiversioning [1] support to Arm 
>> architectures.
>> The specification is made public as beta[2] to ensure toolchain that follows 
>> Arm
>> C Language Extension will implement it in the same way.
>> 
>> A few tweaks considered to make the developers' life easier.
>> Since the `target` attribute is used widely on Arm, we would like to 
>> introduce a
>> new attribute `target_version` to avoid confusion and possible deployment
>> problems. The `target_clones` attribute will be supported too. Also the 
>> “default”
>> version to be made optional.
>> 
>> We are looking for feedback on the specification (reply, github works too).
>> 
>> Thanks so much,
>> Daniel
>> 
>> [1] https://gcc.gnu.org/onlinedocs/gcc/Function-Multiversioning.html 
>> [2] 
>> https://github.com/ARM-software/acle/blob/main/main/acle.md#function-multi-versioning
>> 
> 
> Hello.
> 
> Thanks for working on the feature, it will be nice to cover the gap in 
> between x86_64 and powerpc,
> which implement the FMV feature.
> 
> As the person who's been involved with the current MVC code in the GCC, I 
> have a few comments/questions
> about it:
> 
> 1) both i386 and Powerpc also allow specifying an equivalent to -march (like 
> `arch=bdver2`),
>   in Arm case it seems to me only individual features are considered
Arm architecture version is not definite enough in this case because
certain features are optional on a given versions and may back ported to older 
versions.
Implementation name of a core also could be misleading in most of the cases. 
And too many out there if
all implementation is considered not just Arm’s Cortex cores.
Also the kernel support varies regardless the actual hardware, features can be 
disabled by the firmware/OS.
I think developers target a given feature instead of a given uarch most cases.

> 
> 2) about 'target_version' attribute - I like the idea as one can have a 
> completely independent
>   function implementation optimized for an ISA;
>   note it's very close to 'target' attribute (supported in C++), where one 
> needs to provide
>   a resolver and have the pretty same functionality (see e.g. 
> gcc/testsuite/g++.target/i386/mv1.C).
>   However, the feature does not work in C and you will have the very same 
> problem with target_version
>   attribute (multiple functions with the same declaration):
> 
>  mv1.c:76:1: error: redefinition of ‘foo’
> 76 | foo ()
>| ^~~
In our clang implementation\prototype such a use case is supported. The goal 
was to able to write like this in C
/* existing code*/
extern int foo();
int foo(){}
/* addition */
#ifdef __ARM_FEATURE_FUNCTION_MULTI_VERSIONING
__attribute__((target_version(“...")))
int foo(){}
#endif

so an existing codebase can be extended without breaking it even for old 
compilers, without heavy checks for attribute support.

> 3) If you will implement 'target_version' attribute, I would like to see it 
> available also for the
>   existing targets supporting MVC
Yes, this is the plan if other target maintainers will accept it.
IMHO all semantical differences would work for all targets.
> 
> 4) A small note about the mangling, the existing i386 naming scheme looks 
> like:
> 
> ...
> _Z3foov.avx2_ssse3
> ...
> 
> 5) Can you please define how will you evaluate priorities for a situation 
> where multiple features
>   are used (e.g. dotprod+sm)?
> 
>   Note we face the very same problem on i386, where it's very hard to specify 
> a priority
>   for the family of avx512 features. That said, an optional priority 
> specifier might be possible.
ACLE provides a table of priorities for given feature and a simple algorithm 
how to choose.

Version where the most features are requested will be picked,
then the one with the highest priority.
in case of (dotprod+sm, sve) set the dotprod+sm will be selected just because 
it is more specified, even
sve has higher priority.

We considered the other of the attributes in the source, but that might be 
quite problematic to preserve during
compilation.

A new attribute or variant that provides priority could work too, just so far 
the newer feature usually a better
choice, and those got higher priority.

> 
> 6) Note that as opposed to i385 and Powerpc, we don't allow a combination of 
> ISA flags for target_clone
>   attribute (like sse2+avx512f).
Noted, I think in case of Arm it may make sense to support it.
> 
> 7) FMV may be disabled in compile time by a compiler flag. In this case the 
> default version shall be used.
> 
>   I would like to see the functionality also target agnostic.
Sure, I agree.  the proposed flag is -mno-fmv (-mfmv default on). 
Also maybe the feature indication define 
__ARM_FEATURE_FUNCTION_MULTI_VERSIONING could be just
__FEATURE_FUNCTION_MULTI_VERSIONING?

> 
> Anyway, looking forward to the Ar

gcc-10-20220721 is now available

2022-07-21 Thread GCC Administrator via Gcc
Snapshot gcc-10-20220721 is now available on
  https://gcc.gnu.org/pub/gcc/snapshots/10-20220721/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 10 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch 
releases/gcc-10 revision 8c3238510ce63c75024c0288eade5c933f6d322e

You'll find:

 gcc-10-20220721.tar.xz   Complete GCC

  SHA256=7598d84989a2558c0834b2415ca2dc925d6bfa155aa9f6a3de8b691c579de143
  SHA1=5381f5e43f26d6d18a06ed8682db25c083923e7f

Diffs from 10-20220714 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-10
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.