[RTEMS] Fix moxie libgcc support
Hello, I will back port this to all open branches this Friday if nobody objects: https://gcc.gnu.org/viewcvs/gcc?view=revision=236064 -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH v2] [libatomic] Add RTEMS support
If nobody objects, I will back port this to GCC 6 next Monday. On 20/04/16 14:40, Joel Sherrill wrote: As the other RTEMS target maintainer. I second the request. --joel On Apr 20, 2016 7:35 AM, "Sebastian Huber" <sebastian.hu...@embedded-brains.de <mailto:sebastian.hu...@embedded-brains.de>> wrote: Hello, I know that I am pretty late, but is there a chance to get this into the GCC 6.1 release? On 19/04/16 14:56, Sebastian Huber wrote: v2: Do not use architecture configuration due to broken ARM libatomic support. gcc/ * config/rtems.h (LIB_SPEC): Add -latomic. libatomic/ * configure.tgt (*-*-rtems*): New supported target. * config/rtems/host-config.h: New file. * config/rtems/lock.c: Likewise. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 <tel:%2B49%2089%20189%2047%2041-16> Fax : +49 89 189 47 41-09 <tel:%2B49%2089%20189%2047%2041-09> E-Mail : sebastian.hu...@embedded-brains.de <mailto:sebastian.hu...@embedded-brains.de> PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. ___ devel mailing list de...@rtems.org <mailto:de...@rtems.org> http://lists.rtems.org/mailman/listinfo/devel -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH v2] [libatomic] Add RTEMS support
Ok, what about the GCC trunk? On 20/04/16 14:35, Sebastian Huber wrote: Hello, I know that I am pretty late, but is there a chance to get this into the GCC 6.1 release? On 19/04/16 14:56, Sebastian Huber wrote: v2: Do not use architecture configuration due to broken ARM libatomic support. gcc/ * config/rtems.h (LIB_SPEC): Add -latomic. libatomic/ * configure.tgt (*-*-rtems*): New supported target. * config/rtems/host-config.h: New file. * config/rtems/lock.c: Likewise. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH v2] [libatomic] Add RTEMS support
Hello, I know that I am pretty late, but is there a chance to get this into the GCC 6.1 release? On 19/04/16 14:56, Sebastian Huber wrote: v2: Do not use architecture configuration due to broken ARM libatomic support. gcc/ * config/rtems.h (LIB_SPEC): Add -latomic. libatomic/ * configure.tgt (*-*-rtems*): New supported target. * config/rtems/host-config.h: New file. * config/rtems/lock.c: Likewise. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH v2] [libatomic] Add RTEMS support
v2: Do not use architecture configuration due to broken ARM libatomic support. gcc/ * config/rtems.h (LIB_SPEC): Add -latomic. libatomic/ * configure.tgt (*-*-rtems*): New supported target. * config/rtems/host-config.h: New file. * config/rtems/lock.c: Likewise. --- gcc/config/rtems.h | 2 +- libatomic/config/rtems/host-config.h | 41 libatomic/config/rtems/lock.c| 37 libatomic/configure.tgt | 10 + 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 libatomic/config/rtems/host-config.h create mode 100644 libatomic/config/rtems/lock.c diff --git a/gcc/config/rtems.h b/gcc/config/rtems.h index f13f72f..e005547 100644 --- a/gcc/config/rtems.h +++ b/gcc/config/rtems.h @@ -45,6 +45,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define LIB_SPEC "%{!qrtems: " STD_LIB_SPEC "} " \ "%{!nostdlib: %{qrtems: --start-group \ -lrtemsbsp -lrtemscpu \ - -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}}" + -latomic -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}}" #define TARGET_POSIX_IO diff --git a/libatomic/config/rtems/host-config.h b/libatomic/config/rtems/host-config.h new file mode 100644 index 000..d11e9ef --- /dev/null +++ b/libatomic/config/rtems/host-config.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2016 Free Software Foundation, Inc. + Contributed by Sebastian Huber <sebastian.hu...@embedded-brains.de>. + + This file is part of the GNU Atomic Library (libatomic). + + Libatomic is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Libatomic is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Included after all more target-specific host-config.h. */ + +#include + +static inline UWORD +protect_start (void *ptr) +{ + return _Libatomic_Protect_start (ptr); +} + +static inline void +protect_end (void *ptr, UWORD isr_level) +{ + _Libatomic_Protect_end (ptr, isr_level); +} + +#include_next diff --git a/libatomic/config/rtems/lock.c b/libatomic/config/rtems/lock.c new file mode 100644 index 000..f999f9b --- /dev/null +++ b/libatomic/config/rtems/lock.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2016 Free Software Foundation, Inc. + Contributed by Sebastian Huber <sebastian.hu...@embedded-brains.de>. + + This file is part of the GNU Atomic Library (libatomic). + + Libatomic is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Libatomic is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + +#include "libatomic_i.h" + +void +libat_lock_n (void *ptr, size_t n) +{ + _Libatomic_Lock_n (ptr, n); +} + +void +libat_unlock_n (void *ptr, size_t n) +{ + _Libatomic_Unlock_n (ptr, n); +} diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt index c5470d7..eab2765 100644 --- a/libatomic/configure.tgt +++ b/libatomic/configure.tgt @@ -26,6 +26,10 @@ # Map the target cpu to an ARCH sub-directory. At the same time, # work out any special compilation flags as necessary. +# Give operating systems the opportunity to discard XCFLAGS modifications based +# on ${target_cpu}. For example to allow proper use of multilibs. +configure_tgt_pre_target_cpu_XCFLAGS="${XCFLAGS}" + case "
[PATCH] [libatomic] Add RTEMS support
gcc/ * config/rtems.h (LIB_SPEC): Add -latomic. libatomic/ * configure.tgt (*-*-rtems*): New supported target. * config/rtems/host-config.h: New file. * config/rtems/lock.c: Likewise. --- gcc/config/rtems.h | 2 +- libatomic/config/rtems/host-config.h | 41 libatomic/config/rtems/lock.c| 37 libatomic/configure.tgt | 10 + 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 libatomic/config/rtems/host-config.h create mode 100644 libatomic/config/rtems/lock.c diff --git a/gcc/config/rtems.h b/gcc/config/rtems.h index f13f72f..e005547 100644 --- a/gcc/config/rtems.h +++ b/gcc/config/rtems.h @@ -45,6 +45,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define LIB_SPEC "%{!qrtems: " STD_LIB_SPEC "} " \ "%{!nostdlib: %{qrtems: --start-group \ -lrtemsbsp -lrtemscpu \ - -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}}" + -latomic -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}}" #define TARGET_POSIX_IO diff --git a/libatomic/config/rtems/host-config.h b/libatomic/config/rtems/host-config.h new file mode 100644 index 000..d11e9ef --- /dev/null +++ b/libatomic/config/rtems/host-config.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2016 Free Software Foundation, Inc. + Contributed by Sebastian Huber <sebastian.hu...@embedded-brains.de>. + + This file is part of the GNU Atomic Library (libatomic). + + Libatomic is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Libatomic is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + +/* Included after all more target-specific host-config.h. */ + +#include + +static inline UWORD +protect_start (void *ptr) +{ + return _Libatomic_Protect_start (ptr); +} + +static inline void +protect_end (void *ptr, UWORD isr_level) +{ + _Libatomic_Protect_end (ptr, isr_level); +} + +#include_next diff --git a/libatomic/config/rtems/lock.c b/libatomic/config/rtems/lock.c new file mode 100644 index 000..f999f9b --- /dev/null +++ b/libatomic/config/rtems/lock.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2016 Free Software Foundation, Inc. + Contributed by Sebastian Huber <sebastian.hu...@embedded-brains.de>. + + This file is part of the GNU Atomic Library (libatomic). + + Libatomic is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Libatomic is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + +#include "libatomic_i.h" + +void +libat_lock_n (void *ptr, size_t n) +{ + _Libatomic_Lock_n (ptr, n); +} + +void +libat_unlock_n (void *ptr, size_t n) +{ + _Libatomic_Unlock_n (ptr, n); +} diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt index c5470d7..702286f 100644 --- a/libatomic/configure.tgt +++ b/libatomic/configure.tgt @@ -26,6 +26,10 @@ # Map the target cpu to an ARCH sub-directory. At the same time, # work out any special compilation flags as necessary. +# Give operating systems the opportunity to discard XCFLAGS modifications based +# on ${target_cpu}. For example to allow proper use of multilibs. +configure_tgt_pre_target_cpu_XCFLAGS="${XCFLAGS}" + case "${target_cpu}" in alpha*) # fen
Re: [PATCH] Maybe change __size_t definition in ?
On 15/04/16 12:23, Richard Biener wrote: On Fri, Apr 15, 2016 at 11:44 AM, Sebastian Huber <sebastian.hu...@embedded-brains.de> wrote: >I work currently on a better FreeBSD compatibility for Newlib. For >RTEMS we use the network, USB, SD/MMC stacks from FreeBSD. It would be >nice to use , etc. from Newlib directly to compile FreeBSD >user and kernel space files. > >Various FreeBSD source and header files need a typedef __size_t via >. Unfortunately the GCC provided uses > > #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ > || defined(__DragonFly__) \ > || defined(__FreeBSD_kernel__) > /* __size_t is a typedef on FreeBSD 5, must not trash it. */ > #elif defined (__VMS__) > /* __size_t is also a typedef on VMS. */ > #else > #define __size_t This looks odd - maybe it was meant to be a #undef? OTOH there are a whole lot of other similar cases there which do not make sense to me... No, in case __size_t is defined, then we don't end up in this spot. stddef.h tests for various guard defines and if none of them is defined, then it typedefs size_t and defines all the guard defines to nothing, except for __size_t on some targets. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH] Maybe change __size_t definition in ?
I work currently on a better FreeBSD compatibility for Newlib. For RTEMS we use the network, USB, SD/MMC stacks from FreeBSD. It would be nice to use , etc. from Newlib directly to compile FreeBSD user and kernel space files. Various FreeBSD source and header files need a typedef __size_t via . Unfortunately the GCC provided uses #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ || defined(__DragonFly__) \ || defined(__FreeBSD_kernel__) /* __size_t is a typedef on FreeBSD 5, must not trash it. */ #elif defined (__VMS__) /* __size_t is also a typedef on VMS. */ #else #define __size_t #endif and therefore defines __size_t to nothing on Newlib targets which would trash a __size_t typedef. There exists no Newlib builtin define which we could add here. As a workaround I include before in and undefine __size_t in . This works fine so far, but breaks if someone includes after the first time. This patch would address this issue, but I do not know which other issues it generates. gcc/ChangeLog 2016-04-15 Sebastian Huber <sebastian.hu...@embedded-brains.de> * ginclude/stddef.h (__size_t): Define to __SIZE_TYPE__. --- gcc/ginclude/stddef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h index d711530..8c2e22e 100644 --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -207,7 +207,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; #elif defined (__VMS__) /* __size_t is also a typedef on VMS. */ #else -#define __size_t +#define __size_t __SIZE_TYPE__ #endif #ifndef __SIZE_TYPE__ #define __SIZE_TYPE__ long unsigned int -- 1.8.4.5
Re: [PATCH] [graphite] document that isl-0.16 is supported
On 01/02/16 19:27, Mike Stump wrote: On Jan 29, 2016, at 8:10 AM, Sebastian Pop<s@samsung.com> wrote: >diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi >index 062f42c..3df7974 100644 >--- a/gcc/doc/install.texi >+++ b/gcc/doc/install.texi >@@ -383,7 +383,7 @@ installed but it is not in your default library search path, the >@option{--with-mpc} configure option should be used. See also >@option{--with-mpc-lib} and @option{--with-mpc-include}. > >-@item isl Library version 0.15 or 0.14. >+@item isl Library version 0.16, 0.15, or 0.14. So, they should commit to compatibility with apis vended, and if they do, I think we should say 0.14 or later. This doesn’t mean that we won’t need fixes from time to time or that they will always do this, but generally that is true. If we (they) deviate from this,_then_ we document the exceptions. If release after release goes out, with all newer versions not working, then the list of known good versions is best; but, I’d say that something is terribly broken if we had to do that. It would be good to have a recommended version as well (similar for cloog, gmp, mpc and mpfr). If you present me three versions which one should I choose as a naive user? Are the versions in the contrib/download_prerequisites script the recommended ones? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] [graphite] document that isl-0.16 is supported
On 02/02/16 19:00, Mike Stump wrote: On Feb 2, 2016, at 2:23 AM, Sebastian Huber<sebastian.hu...@embedded-brains.de> wrote: >It would be good to have a recommended version as well (similar for cloog, gmp, mpc and mpfr). If you present me three versions which one should I choose as a naive user? The latest release, or the one on your system. This is so basic that we expect you to already know this. >Are the versions in the contrib/download_prerequisites script the recommended ones? Yes, they are. If it is so basic to choose the latest release or the one on the system, then why uses the contrib/download_prerequisites ancient versions, e.g. the six year old GMP 4.3.2? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] [graphite] document that isl-0.16 is supported
On 03/02/16 07:29, Sebastian Huber wrote: On 02/02/16 19:00, Mike Stump wrote: On Feb 2, 2016, at 2:23 AM, Sebastian Huber<sebastian.hu...@embedded-brains.de> wrote: >It would be good to have a recommended version as well (similar for cloog, gmp, mpc and mpfr). If you present me three versions which one should I choose as a naive user? The latest release, or the one on your system. This is so basic that we expect you to already know this. >Are the versions in the contrib/download_prerequisites script the recommended ones? Yes, they are. If it is so basic to choose the latest release or the one on the system, then why uses the contrib/download_prerequisites ancient versions, e.g. the six year old GMP 4.3.2? There is exactly one version of GMP, MPC and MPFR available via: ftp://gcc.gnu.org/pub/gcc/infrastructure/ This doesn't suggest to me that I should use the latest release. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH] [RTEMS] Add Cortex-M7 multilib for FPU support
gcc/ChangeLog 2016-01-12 Sebastian Huber <sebastian.hu...@embedded-brains.de> * config/arm/t-rtems: Add cortex-m7/fpv5-d16 multilib. --- gcc/config/arm/t-rtems | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/config/arm/t-rtems b/gcc/config/arm/t-rtems index 3b62181..02dcd65 100644 --- a/gcc/config/arm/t-rtems +++ b/gcc/config/arm/t-rtems @@ -1,7 +1,7 @@ # Custom RTEMS multilibs for ARM -MULTILIB_OPTIONS = mbig-endian mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon/mfpu=vfpv3-d16/mfpu=fpv4-sp-d16 mfloat-abi=hard -MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 fpv4-sp-d16 hard +MULTILIB_OPTIONS = mbig-endian mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m/mcpu=cortex-m7 mfpu=neon/mfpu=vfpv3-d16/mfpu=fpv4-sp-d16/mfpu=fpv5-d16 mfloat-abi=hard +MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m cortex-m7 neon vfpv3-d16 fpv4-sp-d16 fpv5-d16 hard # Enumeration of multilibs @@ -16,5 +16,6 @@ MULTILIB_REQUIRED += mthumb/march=armv7-a MULTILIB_REQUIRED += mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard MULTILIB_REQUIRED += mthumb/march=armv7-r MULTILIB_REQUIRED += mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard +MULTILIB_REQUIRED += mthumb/mcpu=cortex-m7/mfpu=fpv5-d16/mfloat-abi=hard MULTILIB_REQUIRED += mthumb/march=armv7-m MULTILIB_REQUIRED += mthumb -- 1.8.4.5
Re: [PATCH] Convert SPARC to LRA
Hello David, since the LRA patch is still reverted on the trunk, I guess the switch to LRA will not happen in GCC 6? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] Add configure flag for operator new (std::nothrow)
On 05/11/15 16:22, Daniel Gutson wrote: On Wed, Nov 4, 2015 at 3:20 AM, Jonathan Wakely<jwakely@gmail.com> wrote: >On 4 November 2015 at 02:11, Daniel Gutson wrote: >>Since this is a nothrow new, we thought that probably the system >>might not be exceptions-friendly (such as certain embedded systems), >>so we wanted to provide the new_handler the ability to do something else >>other than trying to allocate memory and keep the function iterating. > >That could be done using an alternative overload of operator new >instead of altering the semantics of the standard one (that could be >provided as a GNU extension, for example). > >>In fact, our idea is that since the nothrow new can indeed return nullptr, >>let the new_handler do something else and leave the no-memory-consequence >>to the caller. >>This new flag enables just that. > > >The default configuration already allows the caller to deal with >allocation failure from the nothrow version of new, by not installing >a new-handler installed, and dealing with a null return value. How >would I use this alternative configuration? Since the behaviour only >changes when a new-handler is installed, presumably I'm meant to >install some kind of new-handler that does something else ... but >what? The patch should include documentation explaining when and how >to use this option. Real use cases: statistics and logging. It's a (one time) callback reporting that something went wrong, but not intended to fix things e.g. by attempting to free more memory. For statistics and logging you may also use the --wrap option of GNU ld. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] Fix declaration of pthread-structs in s-osinte-rtems.ads
On 31/10/15 16:47, Jan Sommer wrote: Hi, This patch changes the Ada-declaration of the pthread-related structs such as pthread_attr_t from a field-equivalent declaration to just reserving the right amount of memory. It is only rtems related and essentially copies the way how the types are defined in s-osinte-linux.ads. It makes the declarations independent of a particular newlib-version and fixes the bug I filed here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68169 [...] - -- Signals -- @@ -448,6 +450,7 @@ package System.OS_Interface is ss_low_priority : int; ss_replenish_period : timespec; ss_initial_budget : timespec; + sched_ss_max_repl : int; end record; pragma Convention (C, struct_sched_param); Why is this structure not changed to an opaque size + alignment type like the other structures? @@ -621,43 +624,34 @@ private end record; pragma Convention (C, timespec); - CLOCK_REALTIME : constant clockid_t := 1; - CLOCK_MONOTONIC : constant clockid_t := 4; + CLOCK_REALTIME : constant clockid_t := System.OS_Constants.CLOCK_REALTIME; + CLOCK_MONOTONIC : constant clockid_t := System.OS_Constants.CLOCK_MONOTONIC; + + subtype char_array is Interfaces.C.char_array; type pthread_attr_t is record - is_initialized : int; - stackaddr : System.Address; - stacksize : int; - contentionscope : int; - inheritsched: int; - schedpolicy : int; - schedparam : struct_sched_param; - cputime_clocked_allowed : int; - detatchstate: int; + Data : char_array (1 .. OS_Constants.PTHREAD_ATTR_SIZE); end record; pragma Convention (C, pthread_attr_t); + for pthread_attr_t'Alignment use Interfaces.C.unsigned_long'Alignment; type pthread_condattr_t is record - flags : int; - process_shared : int; + Data : char_array (1 .. OS_Constants.PTHREAD_CONDATTR_SIZE); end record; pragma Convention (C, pthread_condattr_t); + for pthread_condattr_t'Alignment use Interfaces.C.int'Alignment; type pthread_mutexattr_t is record - is_initialized : int; - process_shared : int; - prio_ceiling: int; - protocol: int; - mutex_type : int; - recursive : int; - end record; + Data : char_array (1 .. OS_Constants.PTHREAD_MUTEXATTR_SIZE); + end record; pragma Convention (C, pthread_mutexattr_t); + for pthread_mutexattr_t'Alignment use Interfaces.C.int'Alignment; [...] The alignment is sometimes int and sometimes unsigned long. I would change this to long long or double throughout, e.g. if we change the CPU mask type to uint64_t, then the alignment specified here is no longer correct. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [wwwdocs] GCC 6 Release Notes for RTEMS
Hello Gerald, On 31/10/15 21:36, Gerald Pfeifer wrote: Hi Sebastian, what do you think about the follow-up patch below, on top of your original patch? thanks for the style changes. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: Merge from gomp-4_1-branch to trunk
On 14/10/15 10:04, Jakub Jelinek wrote: No, both the above changes are wrong. There is not a single int32_t written, but could be many more, it is an array of 32-bit integers. I'd say you just want to cast explicitly, omp_get_place_proc_ids (*place_num, (int *) ids); and omp_get_parition_place_nums ((int *) place_nums); The reason for int32_t is that on the Fortran side it is integer(kind=4) and everywhere else for that int32_t is used. If this works, the patch is preapproved. I checked this in: https://gcc.gnu.org/viewcvs/gcc?view=revision=228805 -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: Merge from gomp-4_1-branch to trunk
On 14/10/15 10:04, Jakub Jelinek wrote: On Wed, Oct 14, 2015 at 09:34:48AM +0200, Sebastian Huber wrote: >/home/EB/sebastian_h/archive/gcc-git/libgomp/fortran.c:28:0: >/home/EB/sebastian_h/archive/gcc-git/libgomp/fortran.c:73:18: note: expected >'int *' but argument is of type 'int32_t * {aka long int *}' Ugh, wasn't aware that some targets use long int for int32_t:(. This is actually a feature of the newlib-stdint.h: [...] /* newlib uses 32-bit long in certain cases for all non-SPU targets. */ #ifndef STDINT_LONG32 #define STDINT_LONG32 (LONG_TYPE_SIZE == 32) #endif #define SIG_ATOMIC_TYPE "int" /* The newlib logic actually checks for sizes greater than 32 rather than equal to 64 for various 64-bit types. */ #define INT8_TYPE (CHAR_TYPE_SIZE == 8 ? "signed char" : 0) #define INT16_TYPE (SHORT_TYPE_SIZE == 16 ? "short int" : INT_TYPE_SIZE == 16 ? "int" : CHAR_TYPE_SIZE == 16 ? "signed char" : 0) #define INT32_TYPE (STDINT_LONG32 ? "long int" : INT_TYPE_SIZE == 32 ? "int" : SHORT_TYPE_SIZE == 32 ? "short int" : CHAR_TYPE_SIZE == 32 ? "signed char" : 0) [...] This regularly causes problems like this. In addition it leads to a complicated PRI* macro definition in . -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: Merge from gomp-4_1-branch to trunk
Hello, I get now the following error: libtool: compile: /scratch/git-build/b-gcc-git-arm-rtems4.12/./gcc/xgcc -B/scratch/git-build/b-gcc-git-arm-rtems4.12/./gcc/ -nostdinc -B/scratch/git-build/b-gcc-git-arm-rtems4.12/arm-rtems4.12/newlib/ -isystem /scratch/git-build/b-gcc-git-arm-rtems4.12/arm-rtems4.12/newlib/targ-include -isystem /home/EB/sebastian_h/archive/gcc-git/newlib/libc/include -B/opt/rtems-4.12/arm-rtems4.12/bin/ -B/opt/rtems-4.12/arm-rtems4.12/lib/ -isystem /opt/rtems-4.12/arm-rtems4.12/include -isystem /opt/rtems-4.12/arm-rtems4.12/sys-include -DHAVE_CONFIG_H -I. -I/home/EB/sebastian_h/archive/gcc-git/libgomp -I/home/EB/sebastian_h/archive/gcc-git/libgomp/config/rtems -I/home/EB/sebastian_h/archive/gcc-git/libgomp/config/posix -I/home/EB/sebastian_h/archive/gcc-git/libgomp -I/home/EB/sebastian_h/archive/gcc-git/libgomp/../include -Wall -Werror -g -O2 -MT fortran.lo -MD -MP -MF .deps/fortran.Tpo -c /home/EB/sebastian_h/archive/gcc-git/libgomp/fortran.c -o fortran.o /home/EB/sebastian_h/archive/gcc-git/libgomp/fortran.c: In function 'omp_get_place_proc_ids_': /home/EB/sebastian_h/archive/gcc-git/libgomp/fortran.c:484:39: error: passing argument 2 of 'omp_get_place_proc_ids' from incompatible pointer type [-Werror=incompatible-pointer-types] omp_get_place_proc_ids (*place_num, ids); ^ In file included from /home/EB/sebastian_h/archive/gcc-git/libgomp/fortran.c:28:0: /home/EB/sebastian_h/archive/gcc-git/libgomp/fortran.c:73:18: note: expected 'int *' but argument is of type 'int32_t * {aka long int *}' ialias_redirect (omp_get_place_proc_ids) ^ /home/EB/sebastian_h/archive/gcc-git/libgomp/libgomp.h:1011:24: note: in definition of macro 'ialias_redirect' extern __typeof (fn) fn __asm__ (ialias_ulp "gomp_ialias_" #fn) attribute_hidden; ^ /home/EB/sebastian_h/archive/gcc-git/libgomp/fortran.c: In function 'omp_get_partition_place_nums_': /home/EB/sebastian_h/archive/gcc-git/libgomp/fortran.c:508:33: error: passing argument 1 of 'omp_get_partition_place_nums' from incompatible pointer type [-Werror=incompatible-pointer-types] omp_get_partition_place_nums (place_nums); ^ In file included from /home/EB/sebastian_h/archive/gcc-git/libgomp/fortran.c:28:0: /home/EB/sebastian_h/archive/gcc-git/libgomp/fortran.c:76:18: note: expected 'int *' but argument is of type 'int32_t * {aka long int *}' ialias_redirect (omp_get_partition_place_nums) ^ /home/EB/sebastian_h/archive/gcc-git/libgomp/libgomp.h:1011:24: note: in definition of macro 'ialias_redirect' extern __typeof (fn) fn __asm__ (ialias_ulp "gomp_ialias_" #fn) attribute_hidden; We have for example (libgomp/omp_lib.f90.in): subroutine omp_get_place_proc_ids (place_num, ids) integer (4), intent(in) :: place_num integer (4), intent(out) :: ids(*) end subroutine omp_get_place_proc_ids So this interface is different to (libgomp/omp.h.in): extern void omp_get_place_proc_ids (int, int *) __GOMP_NOTHROW; The following patch fixes the problem, but I am not sure if this is really the best way to address this issue: diff --git a/libgomp/fortran.c b/libgomp/fortran.c index ceff9ac..44aaf92 100644 --- a/libgomp/fortran.c +++ b/libgomp/fortran.c @@ -481,7 +481,9 @@ omp_get_place_num_procs_8_ (const int64_t *place_num) void omp_get_place_proc_ids_ (const int32_t *place_num, int32_t *ids) { - omp_get_place_proc_ids (*place_num, ids); + int int_ids; + omp_get_place_proc_ids (*place_num, _ids); + *ids = int_ids; } void @@ -505,7 +507,9 @@ omp_get_partition_num_places_ (void) void omp_get_partition_place_nums_ (int32_t *place_nums) { - omp_get_partition_place_nums (place_nums); + int int_place_nums; + omp_get_partition_place_nums (_place_nums); + *place_nums = int_place_nums; } void -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [patch] libstdc++/67747 Allocate space for dirent::d_name
On 02/10/15 14:16, Florian Weimer wrote: On 09/29/2015 01:37 PM, Jonathan Wakely wrote: >POSIX says that dirent::d_name has an unspecified length, so calls to >readdir_r must pass a buffer with enough trailing space for >{NAME_MAX}+1 characters. I wasn't doing that, which works OK on >GNU/Linux and BSD where d_name is a large array, but fails on Solaris >32-bit. > >This uses pathconf to get NAME_MAX and allocates a buffer. This still has a buffer overflow on certain file systems. You must not use readdir_r, it is deprecated and always insecure. We should probably mark it as such in the glibc headers. The READDIR(3) man page should be updated as well, since it doesn't mention that readdir_r() is deprecated and always insecure. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] Convert SPARC to LRA
On 30/09/15 04:07, Jeff Law wrote: If the port does get occasional fixes (primarily driven by BZs), but not getting updated on a regular basis (such as conversion to LRA, conversion to RTL prologue/epilogue, etc), may be only getting occasional testing, etc. Then it's probably fair to call it in maintenance mode. A great example IMHO would be the m68k. Another criteria would be available hardware for which both the PA and alpha ports are a good example. When you can't buy new hardware then targets that could formerly host GCC quickly rot to the state where only cross-compilation is viable (and having "old" GCC is good enough). Very true. Actually the PA is the best example there. Alpha I believe has a functional-enough QEMU port to do real work and m68k has Aranym which I've used to bootstrap m68k within the last 18 months. Hell, I think Aranym actually ran faster than the last shipping real hardware! You can still buy m68k based chips (e.g. Freescale ColdFire) for embedded systems. http://www.freescale.com/products/more-processors/32-bit-mcu-and-mcp/coldfire-plus-coldfire-mcus-mpus:PC68KCF -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] Update RTEMS multilib for SPARC
On 28/09/15 14:13, Daniel Hellstrom wrote: Now that muser-mode is default the multilib definitions does not require to specify that switch any more. Add UT699 to multilib after recent patches. Add AT697F multilib since there are many LEON2 users running RTEMS. To gcc/ChangeLog: gcc/ * config/sparc/t-rtems: Remove -muser-mode, add ut699 and at697f --- gcc/config/sparc/t-rtems | 25 +++-- 1 files changed, 15 insertions(+), 10 deletions(-) diff --git a/gcc/config/sparc/t-rtems b/gcc/config/sparc/t-rtems index adb6dcb..6f7cc6f 100644 --- a/gcc/config/sparc/t-rtems +++ b/gcc/config/sparc/t-rtems @@ -17,15 +17,20 @@ # <http://www.gnu.org/licenses/>. # -MULTILIB_OPTIONS = msoft-float mcpu=v8/mcpu=leon3/mcpu=leon3v7 muser-mode -MULTILIB_DIRNAMES = soft v8 leon3 leon3v7 user-mode +MULTILIB_OPTIONS = msoft-float mcpu=v8/mcpu=leon3/mcpu=leon3v7/mcpu=leon \ + mfix-ut699/mfix-at697f +MULTILIB_DIRNAMES = soft v8 leon3 leon3v7 leon ut699 at697f MULTILIB_MATCHES = msoft-float=mno-fpu -MULTILIB_EXCEPTIONS = muser-mode -MULTILIB_EXCEPTIONS += mcpu=leon3 -MULTILIB_EXCEPTIONS += mcpu=leon3v7 -MULTILIB_EXCEPTIONS += msoft-float/mcpu=leon3 -MULTILIB_EXCEPTIONS += msoft-float/mcpu=leon3v7 -MULTILIB_EXCEPTIONS += msoft-float/muser-mode -MULTILIB_EXCEPTIONS += msoft-float/mcpu=v8/muser-mode -MULTILIB_EXCEPTIONS += mcpu=v8/muser-mode +MULTILIB_EXCEPTIONS = mfix-ut699 +MULTILIB_EXCEPTIONS += msoft-float/mfix-ut699 +MULTILIB_EXCEPTIONS += msoft-float/mcpu=v8/mfix-ut699 +MULTILIB_EXCEPTIONS += msoft-float/mcpu=leon3*/mfix-ut699 +MULTILIB_EXCEPTIONS += mcpu=v8/mfix-ut699 +MULTILIB_EXCEPTIONS += mcpu=leon3*/mfix-ut699 +MULTILIB_EXCEPTIONS += mfix-at697f +MULTILIB_EXCEPTIONS += msoft-float/mfix-at697f +MULTILIB_EXCEPTIONS += msoft-float/mcpu=v8/mfix-at697f +MULTILIB_EXCEPTIONS += msoft-float/mcpu=leon3*/mfix-at697f +MULTILIB_EXCEPTIONS += mcpu=v8/mfix-at697f +MULTILIB_EXCEPTIONS += mcpu=leon3*/mfix-at697f Why do we need so many variants with fixes for the UT699 (32-bit Fault-Tolerant LEON3FT SPARC V8 Processor) and the AT697F (LEON2-FT)? Why do we have no leon3 variant without fixes for the UT699 and AT697F? Which multilib do you suggest now for the NGMP/GR740? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] Update RTEMS multilib for SPARC
On 28/09/15 14:33, Sebastian Huber wrote: On 28/09/15 14:13, Daniel Hellstrom wrote: Now that muser-mode is default the multilib definitions does not require to specify that switch any more. Add UT699 to multilib after recent patches. Add AT697F multilib since there are many LEON2 users running RTEMS. To gcc/ChangeLog: gcc/ * config/sparc/t-rtems: Remove -muser-mode, add ut699 and at697f --- gcc/config/sparc/t-rtems | 25 +++-- 1 files changed, 15 insertions(+), 10 deletions(-) diff --git a/gcc/config/sparc/t-rtems b/gcc/config/sparc/t-rtems index adb6dcb..6f7cc6f 100644 --- a/gcc/config/sparc/t-rtems +++ b/gcc/config/sparc/t-rtems @@ -17,15 +17,20 @@ # <http://www.gnu.org/licenses/>. # -MULTILIB_OPTIONS = msoft-float mcpu=v8/mcpu=leon3/mcpu=leon3v7 muser-mode -MULTILIB_DIRNAMES = soft v8 leon3 leon3v7 user-mode +MULTILIB_OPTIONS = msoft-float mcpu=v8/mcpu=leon3/mcpu=leon3v7/mcpu=leon \ + mfix-ut699/mfix-at697f +MULTILIB_DIRNAMES = soft v8 leon3 leon3v7 leon ut699 at697f MULTILIB_MATCHES = msoft-float=mno-fpu -MULTILIB_EXCEPTIONS = muser-mode -MULTILIB_EXCEPTIONS += mcpu=leon3 -MULTILIB_EXCEPTIONS += mcpu=leon3v7 -MULTILIB_EXCEPTIONS += msoft-float/mcpu=leon3 -MULTILIB_EXCEPTIONS += msoft-float/mcpu=leon3v7 -MULTILIB_EXCEPTIONS += msoft-float/muser-mode -MULTILIB_EXCEPTIONS += msoft-float/mcpu=v8/muser-mode -MULTILIB_EXCEPTIONS += mcpu=v8/muser-mode +MULTILIB_EXCEPTIONS = mfix-ut699 +MULTILIB_EXCEPTIONS += msoft-float/mfix-ut699 +MULTILIB_EXCEPTIONS += msoft-float/mcpu=v8/mfix-ut699 +MULTILIB_EXCEPTIONS += msoft-float/mcpu=leon3*/mfix-ut699 +MULTILIB_EXCEPTIONS += mcpu=v8/mfix-ut699 +MULTILIB_EXCEPTIONS += mcpu=leon3*/mfix-ut699 +MULTILIB_EXCEPTIONS += mfix-at697f +MULTILIB_EXCEPTIONS += msoft-float/mfix-at697f +MULTILIB_EXCEPTIONS += msoft-float/mcpu=v8/mfix-at697f +MULTILIB_EXCEPTIONS += msoft-float/mcpu=leon3*/mfix-at697f +MULTILIB_EXCEPTIONS += mcpu=v8/mfix-at697f +MULTILIB_EXCEPTIONS += mcpu=leon3*/mfix-at697f Why do we need so many variants with fixes for the UT699 (32-bit Fault-Tolerant LEON3FT SPARC V8 Processor) and the AT697F (LEON2-FT)? Why do we have no leon3 variant without fixes for the UT699 and AT697F? Which multilib do you suggest now for the NGMP/GR740? Sorry, for these stupid questions. Maybe we should change this file to use MULTILIB_REQUIRED, like on rs6000 and arm. Which multilibs do we have after this change? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] Update RTEMS multilib for SPARC
On 28/09/15 15:20, Daniel Hellstrom wrote: Which multilibs do we have after this change? .; soft;@msoft-float v8;@mcpu=v8 leon3;@mcpu=leon3 leon3v7;@mcpu=leon3v7 leon;@mcpu=leon leon/ut699;@mcpu=leon@mfix-ut699 leon/at697f;@mcpu=leon@mfix-at697f soft/v8;@msoft-float@mcpu=v8 soft/leon3;@msoft-float@mcpu=leon3 soft/leon3v7;@msoft-float@mcpu=leon3v7 soft/leon;@msoft-float@mcpu=leon soft/leon/ut699;@msoft-float@mcpu=leon@mfix-ut699 soft/leon/at697f;@msoft-float@mcpu=leon@mfix-at697f Ok, looks good. The change log entry should mention that you add -mcpu=leon multilibs as well. It would be nice if you can update the RTEMS documentation accordingly similar to ARM and PowerPC, e.g. https://docs.rtems.org/doc-current/share/rtems/html/cpu_supplement/ARM-Specific-Information-Multilibs.html#ARM-Specific-Information-Multilibs -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] Update RTEMS multilib for SPARC
On 28/09/15 15:39, Daniel Hellstrom wrote: On 09/28/2015 03:37 PM, Sebastian Huber wrote: On 28/09/15 15:20, Daniel Hellstrom wrote: Which multilibs do we have after this change? .; soft;@msoft-float v8;@mcpu=v8 leon3;@mcpu=leon3 leon3v7;@mcpu=leon3v7 leon;@mcpu=leon leon/ut699;@mcpu=leon@mfix-ut699 leon/at697f;@mcpu=leon@mfix-at697f soft/v8;@msoft-float@mcpu=v8 soft/leon3;@msoft-float@mcpu=leon3 soft/leon3v7;@msoft-float@mcpu=leon3v7 soft/leon;@msoft-float@mcpu=leon soft/leon/ut699;@msoft-float@mcpu=leon@mfix-ut699 soft/leon/at697f;@msoft-float@mcpu=leon@mfix-at697f Ok, looks good. The change log entry should mention that you add -mcpu=leon multilibs as well. Ooh I forgot to mention that, I will add it to the comment. Otherwise is this okay to commit for 4.9, 5 and master now? Since this is a RTEMS only change, I think this is all right. Just make sure the change log entry format is all right. The statements end all with a '.' for example. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [wwwdocs] GCC 6 Release Notes for RTEMS
I checked this in. On 15/09/15 09:49, Sebastian Huber wrote: I think there are some head lines missing: Index: htdocs/gcc-6/changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-6/changes.html,v retrieving revision 1.29 diff -u -r1.29 changes.html --- htdocs/gcc-6/changes.html 15 Sep 2015 07:44:00 - 1.29 +++ htdocs/gcc-6/changes.html 15 Sep 2015 07:48:24 - @@ -205,7 +205,7 @@ - +PowerPC / PowerPC64 / RS6000 A new configuration option ---with-advance-toolchain=at was added for PowerPC 64-bit GNU/Linux systems to use the header files, library @@ -221,13 +221,13 @@ - +Operating Systems - +RTEMS The RTEMS thread model implementation changed. For the mutexes self-contained objects defined in Newlib sys/lock.h are used -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [wwwdocs] GCC 6 Release Notes for RTEMS
I think there are some head lines missing: Index: htdocs/gcc-6/changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-6/changes.html,v retrieving revision 1.29 diff -u -r1.29 changes.html --- htdocs/gcc-6/changes.html 15 Sep 2015 07:44:00 - 1.29 +++ htdocs/gcc-6/changes.html 15 Sep 2015 07:48:24 - @@ -205,7 +205,7 @@ - +PowerPC / PowerPC64 / RS6000 A new configuration option ---with-advance-toolchain=at was added for PowerPC 64-bit GNU/Linux systems to use the header files, library @@ -221,13 +221,13 @@ - +Operating Systems - +RTEMS The RTEMS thread model implementation changed. For the mutexes self-contained objects defined in Newlib sys/lock.h are used -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [wwwdocs] GCC 6 Release Notes for RTEMS
Ping. On 04/09/15 08:26, Sebastian Huber wrote: Index: htdocs/gcc-6/changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-6/changes.html,v retrieving revision 1.25 diff -u -r1.25 changes.html --- htdocs/gcc-6/changes.html 25 Aug 2015 22:27:46 - 1.25 +++ htdocs/gcc-6/changes.html 4 Sep 2015 06:21:14 - @@ -203,6 +203,23 @@ + + +The RTEMS thread model implementation changed. For the mutexes +self-contained objects defined in Newlib sys/lock.h are used +instead of Classic API semaphores. The keys for thread specific data and +the once function are directly defined via pthread.h. +Self-contained condition variables are provided via Newlib +sys/lock.h. The RTEMS thread model supports now the C++11 +threads. + +The OpenMP support uses now self-contained objects provided by Newlib +sys/lock.h and offers a significantly better performance compared +to the POSIX configuration of libgomp. It is possible to +configure thread pools for each scheduler instance via the environment +variable GOMP_RTEMS_THREAD_POOLS. + + -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[wwwdocs] GCC 6 Release Notes for RTEMS
Index: htdocs/gcc-6/changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-6/changes.html,v retrieving revision 1.25 diff -u -r1.25 changes.html --- htdocs/gcc-6/changes.html 25 Aug 2015 22:27:46 - 1.25 +++ htdocs/gcc-6/changes.html 4 Sep 2015 06:21:14 - @@ -203,6 +203,23 @@ + + +The RTEMS thread model implementation changed. For the mutexes +self-contained objects defined in Newlib sys/lock.h are used +instead of Classic API semaphores. The keys for thread specific data and +the once function are directly defined via pthread.h. +Self-contained condition variables are provided via Newlib +sys/lock.h. The RTEMS thread model supports now the C++11 +threads. + +The OpenMP support uses now self-contained objects provided by Newlib +sys/lock.h and offers a significantly better performance compared +to the POSIX configuration of libgomp. It is possible to +configure thread pools for each scheduler instance via the environment +variable GOMP_RTEMS_THREAD_POOLS. + + -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH 3/3] [gomp] Add thread attribute customization
On 03/09/15 12:19, Jakub Jelinek wrote: @@ -292,7 +292,7 @@ gomp_team_start (void (*fn) (void *), void *data, unsigned nthreads, >bool nested; >struct gomp_thread_pool *pool; >unsigned i, n, old_threads_used = 0; >- pthread_attr_t thread_attr, *attr; >+ pthread_attr_t mutable_attr, *attr; Just wonder why have you renamed this variable. It is a thread attribute after all, even after your changes. mutable_attr doesn't make much sense to me. We have only thread attributes in this function: mutable_attr and attr. The attr is initialized with _thread_attr and gomp_thread_attr is supposed to be read-only by this function. Under certain conditions we have to modify the initial attributes. Since gomp_thread_attr is read-only, we have to copy it and then modify the copy. For this we need some storage: mutable_attr. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH 3/3] [gomp] Add thread attribute customization
On 03/09/15 13:05, Jakub Jelinek wrote: On Thu, Sep 03, 2015 at 12:57:53PM +0200, Sebastian Huber wrote: >On 03/09/15 12:19, Jakub Jelinek wrote: > >>@@ -292,7 +292,7 @@ gomp_team_start (void (*fn) (void *), void *data, unsigned nthreads, > >>>bool nested; > >>>struct gomp_thread_pool *pool; > >>>unsigned i, n, old_threads_used = 0; > >>>- pthread_attr_t thread_attr, *attr; > >>>+ pthread_attr_t mutable_attr, *attr; > >Just wonder why have you renamed this variable. It is a thread attribute > >after all, even after your changes. mutable_attr doesn't make much sense to > >me. > >We have only thread attributes in this function: mutable_attr and attr. The >attr is initialized with _thread_attr and gomp_thread_attr is supposed >to be read-only by this function. Under certain conditions we have to modify >the initial attributes. Since gomp_thread_attr is read-only, we have to copy >it and then modify the copy. For this we need some storage: mutable_attr. So use local_thread_attr if you want to stress it, but IMHO thread_attr just just fine. I really don't like mutable_attr. Ok, if I don't rename thread_attr, is the patch ok? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH 3/3] [gomp] Add thread attribute customization
On 03/09/15 13:10, Jakub Jelinek wrote: On Thu, Sep 03, 2015 at 01:09:23PM +0200, Sebastian Huber wrote: We have only thread attributes in this function: mutable_attr and attr. The attr is initialized with _thread_attr and gomp_thread_attr is supposed to be read-only by this function. Under certain conditions we have to modify the initial attributes. Since gomp_thread_attr is read-only, we have to copy it and then modify the copy. For this we need some storage: mutable_attr. So use local_thread_attr if you want to stress it, but IMHO thread_attr just just fine. I really don't like mutable_attr. Ok, if I don't rename thread_attr, is the patch ok? Yes. Thanks a lot for your kind review. I committed the patches as: https://gcc.gnu.org/viewcvs/gcc?view=revision=227439 https://gcc.gnu.org/viewcvs/gcc?view=revision=227440 https://gcc.gnu.org/viewcvs/gcc?view=revision=227441 https://gcc.gnu.org/viewcvs/gcc?view=revision=227442 -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [wwwdocs] Skeleton for GCC 6 release notes
Hello, how can I add something to the release notes? I would like to mention some RTEMS changes. The RTEMS thread model implementation changed. For the mutexes self-contained objects defined in Newlib are used instead of Classic API semaphores. The keys and the once function are directly defined via . Condition variables are provided via Newlib . The RTEMS thread model supports now the C++11 threads. The OpenMP support uses now self-contained objects provided by Newlib and offers a significantly better performance compared to the POSIX configuration. It is possible to configure scheduler instance specific thread pools. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [wwwdocs] Skeleton for GCC 6 release notes
On 04/09/15 00:41, Gerald Pfeifer wrote: Hi Sebastian, On Thu, 3 Sep 2015, Sebastian Huber wrote: >how can I add something to the release notes? I would like to mention >some RTEMS changes. is it possible checking outhttps://gcc.gnu.org/about.html is all you are looking for, or am I thinking to simple?:-) I searched the web and found this page before. Then I clicked at "browse the repository <https://gcc.gnu.org/cgi-bin/cvsweb.cgi/wwwdocs/>" and landed in the GCC sources. This somehow confused me. Using the CVS checkout leads to the right repository. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH v2] [libstdc++] Run tests on RTEMS
On 01/09/15 23:07, Jeff Law wrote: On 09/01/2015 05:02 AM, Sebastian Huber wrote: v2: Include all options and not only "dg-do run ...". libstdc++-v3/ChangeLog 2015-09-01 Sebastian Huber <sebastian.hu...@embedded-brains.de> testsuite/*: Use 's/\*-\*-cygwin\* /&*-*-rtems* /' to add RTEMS target selector to all tests that run on Cygwin. So presumably those tests actually run correctly :-) Not all, but its not that bad: Target is arm-unknown-rtems4.11 Host is arm-unknown-rtems4.11 Build is x86_64-pc-linux-gnu === libstdc++ tests === Schedule of variations: rtems-arm-realview_pbx_a9_qemu/-march=armv7-a/-mthumb/-mfpu=neon/-mfloat-abi=hard Running target rtems-arm-realview_pbx_a9_qemu/-march=armv7-a/-mthumb/-mfpu=neon/-mfloat-abi=hard Using /scratch/git-rtems-testing/dejagnu/boards/rtems-arm-realview_pbx_a9_qemu.exp as board description file for target. Using /usr/share/dejagnu/config/sim.exp as generic interface file for target. Using /usr/share/dejagnu/baseboards/basic-sim.exp as board description file for target. Using /home/EB/sebastian_h/archive/gcc-git/libstdc++-v3/testsuite/config/default.exp as tool-and-target-specific interface file. Running /home/EB/sebastian_h/archive/gcc-git/libstdc++-v3/testsuite/libstdc++-abi/abi.exp ... Running /home/EB/sebastian_h/archive/gcc-git/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp ... FAIL: 25_algorithms/copy/streambuf_iterators/wchar_t/4.cc execution test FAIL: 25_algorithms/find/istreambuf_iterators/wchar_t/2.cc execution test FAIL: 25_algorithms/random_shuffle/moveable.cc execution test FAIL: 27_io/basic_istream/extractors_other/wchar_t/2.cc execution test FAIL: 27_io/basic_istream/get/wchar_t/2.cc execution test FAIL: 27_io/basic_istream/ignore/wchar_t/3.cc execution test FAIL: 27_io/basic_istream/seekg/wchar_t/sstream.cc execution test FAIL: 27_io/basic_istream/tellg/wchar_t/sstream.cc execution test FAIL: 27_io/basic_ostream/inserters_other/wchar_t/1.cc execution test FAIL: 27_io/basic_stringbuf/setbuf/char/4.cc execution test FAIL: 27_io/objects/wchar_t/12048-1.cc execution test FAIL: 27_io/objects/wchar_t/12048-2.cc execution test FAIL: 27_io/objects/wchar_t/12048-3.cc execution test FAIL: 27_io/objects/wchar_t/12048-4.cc execution test WARNING: program timed out. FAIL: 30_threads/async/42819.cc execution test WARNING: program timed out. FAIL: 30_threads/async/49668.cc execution test WARNING: program timed out. FAIL: 30_threads/async/any.cc execution test WARNING: program timed out. FAIL: 30_threads/async/async.cc execution test WARNING: program timed out. FAIL: 30_threads/condition_variable/members/3.cc execution test FAIL: 30_threads/shared_timed_mutex/try_lock/3.cc execution test WARNING: program timed out. FAIL: 30_threads/thread/native_handle/cancel.cc execution test FAIL: 30_threads/timed_mutex/try_lock_until/57641.cc execution test FAIL: tr1/8_c_compatibility/complex/50880.cc (test for excess errors) WARNING: tr1/8_c_compatibility/complex/50880.cc compilation failed to produce executable FAIL: tr1/8_c_compatibility/complex/functions.cc (test for excess errors) Running /home/EB/sebastian_h/archive/gcc-git/libstdc++-v3/testsuite/libstdc++-prettyprinters/prettyprinters.exp ... Running /home/EB/sebastian_h/archive/gcc-git/libstdc++-v3/testsuite/libstdc++-xmethods/xmethods.exp ... === libstdc++ Summary === # of expected passes9029 # of unexpected failures24 # of expected failures 65 # of unsupported tests 726 One issue is a thread cancel/exit misbehaviour/deviation from glibc in RTEMS. Another issue is that the files under libstdc++-v3/testsuite/data are currently not available in our test driver which uses Qemu. I don't think the ChangeLog is strictly OK according to standards. Every file changed is supposed to be listed. I know it's a pain, but until we change those requirements it's probably best to stick with current standards. GIven a context diff or a unidiff, contrib/mklog can generate a skeleton ChangeLog entry for all the referenced files. I think * firstfile: What changed. * secondfile: Likewise. * thirdfile: Likewise. Is fine. OK with the fixed ChangeLog. jeff My first ChangeLog look like this, but then I found this: 2014-05-23 Jonathan Wakely <jwak...@redhat.com> PR libstdc++/60793 * testsuite/*: Use 's/\*-\*-freebsd\* /&*-*-dragonfly* /' to add dragonfly target selector to all tests that run on freebsd. I will fix the ChangeLog. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] [RTEMS] Update RTEMS thread model
Committed: https://gcc.gnu.org/viewcvs/gcc?view=revision=227428 -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH v2] [libstdc++] Run tests on RTEMS
On 01/09/15 23:07, Jeff Law wrote: On 09/01/2015 05:02 AM, Sebastian Huber wrote: v2: Include all options and not only "dg-do run ...". libstdc++-v3/ChangeLog 2015-09-01 Sebastian Huber <sebastian.hu...@embedded-brains.de> testsuite/*: Use 's/\*-\*-cygwin\* /&*-*-rtems* /' to add RTEMS target selector to all tests that run on Cygwin. So presumably those tests actually run correctly :-) I don't think the ChangeLog is strictly OK according to standards. Every file changed is supposed to be listed. I know it's a pain, but until we change those requirements it's probably best to stick with current standards. GIven a context diff or a unidiff, contrib/mklog can generate a skeleton ChangeLog entry for all the referenced files. I think * firstfile: What changed. * secondfile: Likewise. * thirdfile: Likewise. Is fine. OK with the fixed ChangeLog. Committed: https://gcc.gnu.org/viewcvs/gcc?view=revision=227429 -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH] [RTEMS] Update RTEMS thread model
For synchronization objects use the self-contained objects available via Newlib . https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=ecaef05f6601f1e8acb78fb65b411a258f39988a Enable the C++11 threads using . So, the threads are only supported in case the POSIX API is enabled in RTEMS. In the long run support for thread join and detach should be added to the API independent RTEMS services. libgcc/ChangeLog 2015-09-01 Sebastian Huber <sebastian.hu...@embedded-brains.de> * config/gthr-rtems.h (__GTHREADS_CXX0X): New. (__GTHREAD_HAS_COND): Likewise. (__gthread_t): Likewise. (__gthread_cond_t): Likewise. (__gthread_time_t): Likewise. (__GTHREAD_MUTEX_INIT): Likewise. (__GTHREAD_RECURSIVE_MUTEX_INIT): Likewise. (__GTHREAD_COND_INIT): Likewise. (__GTHREAD_COND_INIT_FUNCTION): Likewise. (__GTHREAD_TIME_INIT): Likewise. (__gthread_create): Likewise. (__gthread_join): Likewise. (__gthread_detach): Likewise. (__gthread_equal): Likewise. (__gthread_self): Likewise. (__gthread_yield): Likewise. (__gthread_cond_broadcast): Likewise. (__gthread_cond_signal): Likewise. (__gthread_cond_wait): Likewise. (__gthread_cond_timedwait): Likewise. (__gthread_cond_wait_recursive): Likewise. (__gthread_cond_destroy): Likewise. (rtems_gxx_once): Delete. (rtems_gxx_key_create): Likewise. (rtems_gxx_key_delete): Likewise. (rtems_gxx_getspecific): Likewise. (rtems_gxx_setspecific): Likewise. (rtems_gxx_mutex_init): Likewise. (rtems_gxx_mutex_destroy): Likewise. (rtems_gxx_mutex_lock): Likewise. (rtems_gxx_mutex_trylock): Likewise. (rtems_gxx_mutex_unlock): Likewise. (rtems_gxx_recursive_mutex_init): Likewise. (rtems_gxx_recursive_mutex_lock): Likewise. (rtems_gxx_recursive_mutex_trylock): Likewise. (rtems_gxx_recursive_mutex_unlock): Likewise. (__GTHREAD_ONCE_INIT): Use initializer. (__GTHREAD_MUTEX_INIT_FUNCTION): Use function. (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): Likewise. (__gthread_once): Likewise. (__gthread_key_create): Likewise. (__gthread_key_delete): Likewise. (__gthread_getspecific): Likewise. (__gthread_setspecific): Likewise. (__gthread_key_t): Use type. (__gthread_once_t): Likewise (__gthread_mutex_t): Use type. (__gthread_recursive_mutex_t): Likewise (__gthread_mutex_lock): Use function. (__gthread_mutex_trylock): Likewise. (__gthread_mutex_timedlock): Likewise. (__gthread_mutex_unlock): Likewise. (__gthread_mutex_destroy): Likewise. (__gthread_recursive_mutex_lock): Likewise. (__gthread_recursive_mutex_trylock): Likewise. (__gthread_recursive_mutex_timedlock): Likewise. (__gthread_recursive_mutex_unlock): Likewise. (__gthread_recursive_mutex_destroy): Likewise. --- libgcc/config/gthr-rtems.h | 195 - 1 file changed, 139 insertions(+), 56 deletions(-) diff --git a/libgcc/config/gthr-rtems.h b/libgcc/config/gthr-rtems.h index 23038c6..1aff329 100644 --- a/libgcc/config/gthr-rtems.h +++ b/libgcc/config/gthr-rtems.h @@ -27,134 +27,217 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifndef GCC_GTHR_RTEMS_H #define GCC_GTHR_RTEMS_H +#include +#include +#include + #ifdef __cplusplus extern "C" { #endif #define __GTHREADS 1 +#define __GTHREADS_CXX0X 1 +#define __GTHREAD_HAS_COND 1 + +typedef pthread_t __gthread_t; +typedef pthread_key_t __gthread_key_t; +typedef pthread_once_t __gthread_once_t; +typedef struct _Mutex_Control __gthread_mutex_t; +typedef struct _Mutex_recursive_Control __gthread_recursive_mutex_t; +typedef struct _Condition_Control __gthread_cond_t; +typedef struct timespec __gthread_time_t; + +#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT +#define __GTHREAD_MUTEX_INIT _MUTEX_INITIALIZER +#define __GTHREAD_MUTEX_INIT_FUNCTION _Mutex_Initialize +#define __GTHREAD_RECURSIVE_MUTEX_INIT _MUTEX_RECURSIVE_INITIALIZER +#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION _Mutex_recursive_Initialize +#define __GTHREAD_COND_INIT _CONDITION_INITIALIZER +#define __GTHREAD_COND_INIT_FUNCTION _Condition_Initialize +#define __GTHREAD_TIME_INIT {0, 0} -#define __GTHREAD_ONCE_INIT 0 -#define __GTHREAD_MUTEX_INIT_FUNCTION rtems_gxx_mutex_init -#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION rtems_gxx_recursive_mutex_init - -/* Avoid dependency on rtems specific headers. */ -typedef void *__gthread_key_t; -typedef int __gthread_once_t; -typedef void *__gthread_mutex_t; -typedef void *__gthread_recursive_mutex_t; - -/* - * External functions provided by RTEMS. They are very similar to their POSIX - * counterparts. A "Wrapper API&q
[PATCH] libstdc++/67408
2015-09-01 Sebastian Huber <sebastian.hu...@embedded-brains.de> PR libstdc++/67408 * include/std/mutex (__timed_mutex_impl): Use __timedlock(). (timed_mutex): Add friend class __timed_mutex_impl. Add __timedlock(). (recursive_timed_mutex): Likewise. --- libstdc++-v3/include/std/mutex | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index deb85df..2958e01 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -230,8 +230,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static_cast(__ns.count()) }; - auto __mutex = static_cast<_Derived*>(this)->native_handle(); - return !__gthread_mutex_timedlock(__mutex, &__ts); + return !static_cast<_Derived*>(this)->__timedlock(&__ts); } template @@ -293,6 +292,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION native_handle_type native_handle() { return &_M_mutex; } + + private: +friend class __timed_mutex_impl; + +int +__timedlock(const __gthread_time_t *__abs_timeout) +{ return __gthread_mutex_timedlock(&_M_mutex, __abs_timeout); } }; /// recursive_timed_mutex @@ -346,6 +352,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION native_handle_type native_handle() { return &_M_mutex; } + + private: +friend class __timed_mutex_impl; + +int +__timedlock(const __gthread_time_t *__abs_timeout) +{ return __gthread_recursive_mutex_timedlock(&_M_mutex, __abs_timeout); } }; #endif #endif // _GLIBCXX_HAS_GTHREADS -- 1.8.4.5
Re: [PATCH] [gomp] Simplify thread pool initialization
Ping. On 28/07/15 13:06, Sebastian Huber wrote: Ping. This is a pre-requisite for: https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02347.html On 22/07/15 14:56, Sebastian Huber wrote: Move the thread pool initialization from the team start to the team creation. This eliminates one conditional expression. In addition this is a preparation patch to enable shared thread pools which I would like to use for RTEMS later. No unexpected failures on x86_64-unknown-linux-gnu. libgomp/ChangeLog 2015-07-22 Sebastian Huber <sebastian.hu...@embedded-brains.de> * team.c (gomp_new_thread_pool): Delete and move content to ... (gomp_get_thread_pool): ... new function. Allocate and initialize thread pool on demand. (get_last_team): Use gomp_get_thread_pool(). (gomp_team_start): Delete thread pool initialization. --- -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH 3/3] [gomp] Add thread attribute customization
libgomp/ChangeLog 2015-07-28 Sebastian Huber sebastian.hu...@embedded-brains.de * config/posix/pool.h (gomp_adjust_thread_attr): New. * config/rtems/pool.h (gomp_adjust_thread_attr): Likewise. (gomp_thread_pool_reservoir): Add priority member. * confi/rtems/proc.c (allocate_thread_pool_reservoir): Add priority. (parse_thread_pools): Likewise. * team.c (gomp_team_start): Rename thread_attr to mutable_attr. Call configuration provided gomp_adjust_thread_attr(). Destroy mutable attributes if necessary. * libgomp.texi: Document GOMP_RTEMS_THREAD_POOLS. --- libgomp/config/posix/pool.h | 7 + libgomp/config/rtems/pool.h | 29 ++ libgomp/config/rtems/proc.c | 23 +++--- libgomp/libgomp.texi| 75 +++-- libgomp/team.c | 15 - 5 files changed, 121 insertions(+), 28 deletions(-) diff --git a/libgomp/config/posix/pool.h b/libgomp/config/posix/pool.h index 0d127a0..a8e2eec 100644 --- a/libgomp/config/posix/pool.h +++ b/libgomp/config/posix/pool.h @@ -57,4 +57,11 @@ gomp_release_thread_pool (struct gomp_thread_pool *pool) /* Do nothing in the default implementation. */ } +static inline pthread_attr_t * +gomp_adjust_thread_attr (pthread_attr_t *attr, pthread_attr_t *mutable_attr) +{ + /* Do nothing in the default implementation. */ + return attr; +} + #endif /* GOMP_POOL_H */ diff --git a/libgomp/config/rtems/pool.h b/libgomp/config/rtems/pool.h index 5c989d0..facac05 100644 --- a/libgomp/config/rtems/pool.h +++ b/libgomp/config/rtems/pool.h @@ -41,6 +41,7 @@ struct gomp_thread_pool_reservoir { gomp_sem_t available; gomp_mutex_t lock; size_t index; + int priority; struct gomp_thread_pool *pools[]; }; @@ -125,4 +126,32 @@ gomp_release_thread_pool (struct gomp_thread_pool *pool) } } +static inline pthread_attr_t * +gomp_adjust_thread_attr (pthread_attr_t *attr, pthread_attr_t *mutable_attr) +{ + struct gomp_thread_pool_reservoir *res = gomp_get_thread_pool_reservoir (); + if (res != NULL res-priority 0) +{ + struct sched_param param; + int err; + if (attr != mutable_attr) + { + attr = mutable_attr; + pthread_attr_init (attr); + } + memset (param, 0, sizeof (param)); + param.sched_priority = res-priority; + err = pthread_attr_setschedparam (attr, param); + if (err != 0) + gomp_fatal (Thread attribute set scheduler parameters failed: %s, strerror (err)); + err = pthread_attr_setschedpolicy (attr, SCHED_FIFO); + if (err != 0) + gomp_fatal (Thread attribute set scheduler policy failed: %s, strerror (err)); + err = pthread_attr_setinheritsched (attr, PTHREAD_EXPLICIT_SCHED); + if (err != 0) + gomp_fatal (Thread attribute set explicit scheduler failed: %s, strerror (err)); +} + return attr; +} + #endif /* GOMP_POOL_H */ diff --git a/libgomp/config/rtems/proc.c b/libgomp/config/rtems/proc.c index 9c36dcb..2939928 100644 --- a/libgomp/config/rtems/proc.c +++ b/libgomp/config/rtems/proc.c @@ -48,7 +48,8 @@ allocate_thread_pool_reservoirs (void) } static void -allocate_thread_pool_reservoir (unsigned long count, unsigned long scheduler) +allocate_thread_pool_reservoir (unsigned long count, unsigned long priority, + unsigned long scheduler) { struct gomp_thread_pool_reservoir *res; struct gomp_thread_pool *pools; @@ -63,6 +64,7 @@ allocate_thread_pool_reservoir (unsigned long count, unsigned long scheduler) memset (pools, 0, size); res = (struct gomp_thread_pool_reservoir *) (pools + count); res-index = count; + res-priority = priority; gomp_sem_init (res-available, count); gomp_mutex_init (res-lock); for (i = 0; i count; ++i) @@ -71,7 +73,8 @@ allocate_thread_pool_reservoir (unsigned long count, unsigned long scheduler) } static char * -parse_thread_pools (char *env, unsigned long *count, unsigned long *scheduler) +parse_thread_pools (char *env, unsigned long *count, unsigned long *priority, + unsigned long *scheduler) { size_t len; int i; @@ -84,6 +87,17 @@ parse_thread_pools (char *env, unsigned long *count, unsigned long *scheduler) if (errno != 0) gomp_fatal (Invalid thread pool count); + if (*env == '$') +{ + ++env; + errno = 0; + *priority = strtoul (env, env, 10); + if (errno != 0) + gomp_fatal (Invalid thread pool priority); +} + else +*priority = -1; + if (*env != '@') gomp_fatal (Invalid thread pool scheduler prefix); ++env; @@ -110,9 +124,10 @@ init_thread_pool_reservoirs (void) while (*env != '\0') { unsigned long count; + unsigned long priority; unsigned long scheduler; - env = parse_thread_pools (env, count, scheduler); - allocate_thread_pool_reservoir (count, scheduler
[PATCH 2/3] [gomp] Thread pool management
In RTEMS we may have multiple scheduler instances with different scheduling algorithms. In addition we have a single process environment so all threads run in one address space. In order to support work stealing applications it is important to limit the number of thread pools used for OpenMP since otherwise we may end up in an explosion of OpenMP worker threads. libgomp/ChangeLog 2015-07-28 Sebastian Huber sebastian.hu...@embedded-brains.de * config/posix/pool.h: New. * config/rtems/pool.h: Likewise. * config/rtems/proc.c: Likewise. * libgomp.h (gomp_thread_destructor): Declare. * team.c: Include configuration provided pool.h. (gomp_get_thread_pool): Define in configuration. (gomp_team_end): Call configuration defined gomp_release_thread_pool(). --- libgomp/config/posix/pool.h | 60 ++ libgomp/config/rtems/pool.h | 128 ++ libgomp/config/rtems/proc.c | 145 libgomp/libgomp.h | 2 + libgomp/team.c | 22 +-- 5 files changed, 337 insertions(+), 20 deletions(-) create mode 100644 libgomp/config/posix/pool.h create mode 100644 libgomp/config/rtems/pool.h create mode 100644 libgomp/config/rtems/proc.c diff --git a/libgomp/config/posix/pool.h b/libgomp/config/posix/pool.h new file mode 100644 index 000..0d127a0 --- /dev/null +++ b/libgomp/config/posix/pool.h @@ -0,0 +1,60 @@ +/* Copyright (C) 2005-2015 Free Software Foundation, Inc. + Contributed by Sebastian Huber sebastian.hu...@embedded-brains.de. + + This file is part of the GNU Offloading and Multi Processing Library + (libgomp). + + Libgomp is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + http://www.gnu.org/licenses/. */ + +/* This is the default implementation of the thread pool management + for libgomp. This type is private to the library. */ + +#ifndef GOMP_POOL_H +#define GOMP_POOL_H 1 + +#include libgomp.h + +/* Get the thread pool, allocate and initialize it on demand. */ + +static inline struct gomp_thread_pool * +gomp_get_thread_pool (struct gomp_thread *thr, unsigned nthreads) +{ + struct gomp_thread_pool *pool = thr-thread_pool; + if (__builtin_expect (pool == NULL, 0)) +{ + pool = gomp_malloc (sizeof (*pool)); + pool-threads = NULL; + pool-threads_size = 0; + pool-threads_used = 0; + pool-last_team = NULL; + pool-threads_busy = nthreads; + thr-thread_pool = pool; + pthread_setspecific (gomp_thread_destructor, thr); +} + return pool; +} + +static inline void +gomp_release_thread_pool (struct gomp_thread_pool *pool) +{ + /* Do nothing in the default implementation. */ +} + +#endif /* GOMP_POOL_H */ diff --git a/libgomp/config/rtems/pool.h b/libgomp/config/rtems/pool.h new file mode 100644 index 000..5c989d0 --- /dev/null +++ b/libgomp/config/rtems/pool.h @@ -0,0 +1,128 @@ +/* Copyright (C) 2015 Free Software Foundation, Inc. + Contributed by Sebastian Huber sebastian.hu...@embedded-brains.de. + + This file is part of the GNU Offloading and Multi Processing Library + (libgomp). + + Libgomp is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + http://www.gnu.org/licenses/. */ + +/* This is the RTEMS implementation
[PATCH 1/3] [gomp] Add RTEMS configuration
libgomp/ChangeLog 2015-07-28 Sebastian Huber sebastian.hu...@embedded-brains.de * config/rtems/bar.c: New. * config/rtems/bar.h: Likewise. * config/rtems/mutex.c: Likewise. * config/rtems/mutex.h: Likewise. * config/rtems/sem.c: Likewise. * config/rtems/sem.h: Likewise. * configure.ac (*-*-rtems*): Check that Newlib provides a proper sys/lock.h header file. * configure.tgt (*-*-rtems*): Enable RTEMS configuration if supported by Newlib. * configure: Regenerate. --- libgomp/config/rtems/bar.c | 255 +++ libgomp/config/rtems/bar.h | 170 + libgomp/config/rtems/mutex.c | 1 + libgomp/config/rtems/mutex.h | 57 ++ libgomp/config/rtems/sem.c | 1 + libgomp/config/rtems/sem.h | 55 ++ libgomp/configure| 17 +++ libgomp/configure.ac | 7 ++ libgomp/configure.tgt| 7 ++ 9 files changed, 570 insertions(+) create mode 100644 libgomp/config/rtems/bar.c create mode 100644 libgomp/config/rtems/bar.h create mode 100644 libgomp/config/rtems/mutex.c create mode 100644 libgomp/config/rtems/mutex.h create mode 100644 libgomp/config/rtems/sem.c create mode 100644 libgomp/config/rtems/sem.h diff --git a/libgomp/config/rtems/bar.c b/libgomp/config/rtems/bar.c new file mode 100644 index 000..05bb320 --- /dev/null +++ b/libgomp/config/rtems/bar.c @@ -0,0 +1,255 @@ +/* Copyright (C) 2005-2015 Free Software Foundation, Inc. + Contributed by Sebastian Huber sebastian.hu...@embedded-brains.de. + + This file is part of the GNU OpenMP Library (libgomp). + + Libgomp is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + http://www.gnu.org/licenses/. */ + +/* This is the RTEMS implementation of a barrier synchronization + mechanism for libgomp. It is identical to the Linux implementation, except + that the futex API is slightly different. This type is private to the + library. */ + +#include libgomp.h +#include bar.h +#include limits.h + +static gomp_barrier_t * +generation_to_barrier(int *addr) +{ + return (gomp_barrier_t *) +((char *) addr - __builtin_offsetof (gomp_barrier_t, generation)); +} + +static void +futex_wait (int *addr, int val) +{ + gomp_barrier_t *bar = generation_to_barrier (addr); + _Futex_Wait (bar-futex, addr, val); +} + +static void +futex_wake (int *addr, int count) +{ + gomp_barrier_t *bar = generation_to_barrier (addr); + _Futex_Wake (bar-futex, count); +} + +static int +do_spin (int *addr, int val) +{ + unsigned long long i, count = gomp_spin_count_var; + + if (__builtin_expect (gomp_managed_threads gomp_available_cpus, 0)) +count = gomp_throttled_spin_count_var; + for (i = 0; i count; i++) +if (__builtin_expect (__atomic_load_n (addr, MEMMODEL_RELAXED) != val, 0)) + return 0; + return 1; +} + +static void +do_wait (int *addr, int val) +{ + if (do_spin (addr, val)) +futex_wait (addr, val); +} + +/* Everything below this point should be identical to the Linux + implementation. */ + +void +gomp_barrier_wait_end (gomp_barrier_t *bar, gomp_barrier_state_t state) +{ + if (__builtin_expect (state BAR_WAS_LAST, 0)) +{ + /* Next time we'll be awaiting TOTAL threads again. */ + bar-awaited = bar-total; + __atomic_store_n (bar-generation, bar-generation + BAR_INCR, + MEMMODEL_RELEASE); + futex_wake ((int *) bar-generation, INT_MAX); +} + else +{ + do + do_wait ((int *) bar-generation, state); + while (__atomic_load_n (bar-generation, MEMMODEL_ACQUIRE) == state); +} +} + +void +gomp_barrier_wait (gomp_barrier_t *bar) +{ + gomp_barrier_wait_end (bar, gomp_barrier_wait_start (bar)); +} + +/* Like gomp_barrier_wait, except that if the encountering thread + is not the last one to hit the barrier, it returns immediately. + The intended usage is that a thread which intends to gomp_barrier_destroy + this barrier calls gomp_barrier_wait, while all other threads + call gomp_barrier_wait_last. When gomp_barrier_wait returns, + the barrier
Re: [PATCH] [gomp] Simplify thread pool initialization
Ping. This is a pre-requisite for: https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02347.html On 22/07/15 14:56, Sebastian Huber wrote: Move the thread pool initialization from the team start to the team creation. This eliminates one conditional expression. In addition this is a preparation patch to enable shared thread pools which I would like to use for RTEMS later. No unexpected failures on x86_64-unknown-linux-gnu. libgomp/ChangeLog 2015-07-22 Sebastian Huber sebastian.hu...@embedded-brains.de * team.c (gomp_new_thread_pool): Delete and move content to ... (gomp_get_thread_pool): ... new function. Allocate and initialize thread pool on demand. (get_last_team): Use gomp_get_thread_pool(). (gomp_team_start): Delete thread pool initialization. --- -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH] [gomp] Simplify thread pool initialization
Move the thread pool initialization from the team start to the team creation. This eliminates one conditional expression. In addition this is a preparation patch to enable shared thread pools which I would like to use for RTEMS later. No unexpected failures on x86_64-unknown-linux-gnu. libgomp/ChangeLog 2015-07-22 Sebastian Huber sebastian.hu...@embedded-brains.de * team.c (gomp_new_thread_pool): Delete and move content to ... (gomp_get_thread_pool): ... new function. Allocate and initialize thread pool on demand. (get_last_team): Use gomp_get_thread_pool(). (gomp_team_start): Delete thread pool initialization. --- libgomp/team.c | 56 +++- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/libgomp/team.c b/libgomp/team.c index 7671b05..5c56182 100644 --- a/libgomp/team.c +++ b/libgomp/team.c @@ -134,22 +134,39 @@ gomp_thread_start (void *xdata) return NULL; } +/* Get the thread pool, allocate and initialize it on demand. */ + +static struct gomp_thread_pool * +gomp_get_thread_pool (struct gomp_thread *thr, unsigned nthreads) +{ + struct gomp_thread_pool *pool = thr-thread_pool; + if (__builtin_expect (pool == NULL, 0)) +{ + pool = gomp_malloc (sizeof (*pool)); + pool-threads = NULL; + pool-threads_size = 0; + pool-threads_used = 0; + pool-last_team = NULL; + pool-threads_busy = nthreads; + thr-thread_pool = pool; + pthread_setspecific (gomp_thread_destructor, thr); +} + return pool; +} + static inline struct gomp_team * get_last_team (unsigned nthreads) { struct gomp_thread *thr = gomp_thread (); if (thr-ts.team == NULL) { - struct gomp_thread_pool *pool = thr-thread_pool; - if (pool != NULL) - { - struct gomp_team *last_team = pool-last_team; - if (last_team != NULL last_team-nthreads == nthreads) - { - pool-last_team = NULL; - return last_team; - } - } + struct gomp_thread_pool *pool = gomp_get_thread_pool (thr, nthreads); + struct gomp_team *last_team = pool-last_team; + if (last_team != NULL last_team-nthreads == nthreads) +{ + pool-last_team = NULL; + return last_team; +} } return NULL; } @@ -219,19 +236,6 @@ free_team (struct gomp_team *team) free (team); } -/* Allocate and initialize a thread pool. */ - -static struct gomp_thread_pool *gomp_new_thread_pool (void) -{ - struct gomp_thread_pool *pool -= gomp_malloc (sizeof(struct gomp_thread_pool)); - pool-threads = NULL; - pool-threads_size = 0; - pool-threads_used = 0; - pool-last_team = NULL; - return pool; -} - static void gomp_free_pool_helper (void *thread_pool) { @@ -316,12 +320,6 @@ gomp_team_start (void (*fn) (void *), void *data, unsigned nthreads, thr = gomp_thread (); nested = thr-ts.team != NULL; - if (__builtin_expect (thr-thread_pool == NULL, 0)) -{ - thr-thread_pool = gomp_new_thread_pool (); - thr-thread_pool-threads_busy = nthreads; - pthread_setspecific (gomp_thread_destructor, thr); -} pool = thr-thread_pool; task = thr-task; icv = task ? task-icv : gomp_global_icv; -- 1.8.4.5
Re: [PATCH] [gomp] Recycle non-nested team if possible
Thanks, I checked this in: https://gcc.gnu.org/viewcvs/gcc?view=revisionrevision=225811 -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: undefined reference to `acc_copyin_array_h_'
On 15/07/15 14:16, Thomas Schwinge wrote: Hallo! On Tue, 14 Jul 2015 13:47:41 +0200, Sebastian Huber sebastian.hu...@embedded-brains.de wrote: [...] I run the test suite on x86_64-unknown-linux-gnu with the previously mentioned asserts and got no unexpected failures. With --disable-linux-futex (without asserts) I got several failures, but none of them is related to my patch, e.g. they are of the following type /tmp/ccw4RofR.o: In function `main': data-already-3.f:(.text+0x56): undefined reference to `acc_copyin_array_h_' Hmm, I have difficulties seeing how --disable-linux-futex and/or your libgomp/team.c could have any effect on OpenACC Fortran; I've not yet been able to reproduce this. Can you please tell me your complete GCC configuration command line, etc., as well as cite from libgomp.log a FAILing invocation command line: I deleted my build tree and started from scratch with the latest trunk version. Now I don't get errors with --disable-linux-futex: Native configuration is x86_64-unknown-linux-gnu === libgomp tests === Schedule of variations: unix Running target unix Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. Using /usr/share/dejagnu/config/unix.exp as generic interface file for target. Using gcc-git/libgomp/testsuite/config/default.exp as tool-and-target-specific interface file. Running gcc-git/libgomp/testsuite/libgomp.c/c.exp ... Running gcc-git/libgomp/testsuite/libgomp.c++/c++.exp ... Running gcc-git/libgomp/testsuite/libgomp.fortran/fortran.exp ... Running gcc-git/libgomp/testsuite/libgomp.graphite/graphite.exp ... Running gcc-git/libgomp/testsuite/libgomp.oacc-c/c.exp ... Running gcc-git/libgomp/testsuite/libgomp.oacc-c++/c++.exp ... Running gcc-git/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp ... === libgomp Summary === # of expected passes5145 # of expected failures 8 # of unsupported tests 258 Sorry for the confusion, I guess that I somehow damaged my previous build tree. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] [gomp] Recycle non-nested team if possible
On 14/07/15 09:04, Sebastian Huber wrote: #include assert.h static inline struct gomp_team * get_last_team (unsigned nthreads) { struct gomp_thread *thr = gomp_thread (); if (thr-ts.team == NULL) { struct gomp_thread_pool *pool = thr-thread_pool; if (pool != NULL) { struct gomp_team *last_team = pool-last_team; if (last_team != NULL last_team-nthreads == nthreads) { pool-last_team = NULL; assert (last_team-barrier.total == nthreads); assert (last_team-barrier.awaited == nthreads); assert (last_team-barrier.awaited_final == nthreads); assert (last_team-barrier.generation % BAR_INCR != 0); Sorry, this should be: assert (last_team-barrier.generation % BAR_INCR == 0); I pasted the wrong version, since I wanted to check that I get a failure in case generation % BAR_INCR != 0. return last_team; } } } return NULL; } -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] [gomp] Recycle non-nested team if possible
On 13/07/15 16:33, Sebastian Huber wrote: On 13/07/15 16:17, Jakub Jelinek wrote: On Mon, Jul 13, 2015 at 01:15:44PM +0200, Sebastian Huber wrote: diff --git a/libgomp/team.c b/libgomp/team.c index b98b233..0bcbaf8 100644 --- a/libgomp/team.c +++ b/libgomp/team.c @@ -134,6 +134,25 @@ gomp_thread_start (void *xdata) return NULL; } +static struct gomp_team * +get_recycable_team (unsigned nthreads) That would be recyclable. But I think get_last_team would be better. Ok. Also, please make it static inline. Out of curiosity, does this make a difference for a static function in a module if it has the inline or not? + team = gomp_malloc (sizeof (*team) + nthreads * extra); + +#ifndef HAVE_SYNC_BUILTINS + gomp_mutex_init (team-work_share_list_free_lock); +#endif Avoiding gomp_mutex_destroy/gomp_mutex_init is fine, but I must say I'm far less sure about gomp_sem_init (can you add there a temporary assert that it has the expected value) and even less about gomp_barrier_init (I think e.g. on Linux generation will be very unlikely 0 that it should be, and not sure about awaited_final value either). Jakub I didn't observe any testsuite failures on x86_64-unknown-linux-gnu with this patch. I will add asserts and re-run the testsuite tomorrow. The team-master_release semaphore is not always zero after use. I got a test failure here: pr29947-2.exe: libgomp/team.c:152: get_last_team: Assertion `last_team-master_release == 0' failed. The state of barrier seems to be all right. I added these assertions: #include assert.h static inline struct gomp_team * get_last_team (unsigned nthreads) { struct gomp_thread *thr = gomp_thread (); if (thr-ts.team == NULL) { struct gomp_thread_pool *pool = thr-thread_pool; if (pool != NULL) { struct gomp_team *last_team = pool-last_team; if (last_team != NULL last_team-nthreads == nthreads) { pool-last_team = NULL; assert (last_team-barrier.total == nthreads); assert (last_team-barrier.awaited == nthreads); assert (last_team-barrier.awaited_final == nthreads); assert (last_team-barrier.generation % BAR_INCR != 0); return last_team; } } } return NULL; } None of them fails if I run the test suite. Running libgomp/testsuite/libgomp.c/c.exp ... Running libgomp/testsuite/libgomp.c++/c++.exp ... Running libgomp/testsuite/libgomp.fortran/fortran.exp ... Running libgomp/testsuite/libgomp.graphite/graphite.exp ... Running libgomp/testsuite/libgomp.oacc-c/c.exp ... Running libgomp/testsuite/libgomp.oacc-c++/c++.exp ... Running libgomp/testsuite/libgomp.oacc-fortran/fortran.exp ... === libgomp Summary === # of expected passes5987 # of expected failures 8 # of unsupported tests 278 Should I still leave the barrier init as is? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] [gomp] Recycle non-nested team if possible
On 14/07/15 09:19, Jakub Jelinek wrote: On Tue, Jul 14, 2015 at 09:09:01AM +0200, Sebastian Huber wrote: I pasted the wrong version, since I wanted to check that I get a failure in case generation % BAR_INCR != 0. There is also config/posix/bar* implementation, which would need to be checked too. I'd suggest first committing a patch with both sem and mutex being destroyed (note, config/posix/bar* has two semaphores in it), and perhaps if you feel strongly about it an incremental patch to avoid the destroying/initialization of the barrier if it works even with config/posix/bar*. Jakub If I destroy the barrier of the last team, and then initialize it later in gomp_new_team() +static inline struct gomp_team * +get_last_team (unsigned nthreads) +{ + struct gomp_thread *thr = gomp_thread (); + if (thr-ts.team == NULL) +{ + struct gomp_thread_pool *pool = thr-thread_pool; + if (pool != NULL) + { + struct gomp_team *last_team = pool-last_team; + if (last_team != NULL last_team-nthreads == nthreads) + { + pool-last_team = NULL; + gomp_barrier_destroy (last_team-barrier); + return last_team; + } + } +} + return NULL; +} then I get test suite failures. Is it safe to destroy the team barrier here or do we circumvent the last team mechanism which is supposed to delay the destruction? Example failure: WARNING: program timed out. FAIL: libgomp.c/appendix-a/a.15.1.c execution test -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] [gomp] Recycle non-nested team if possible
On 14/07/15 12:44, Jakub Jelinek wrote: On Tue, Jul 14, 2015 at 11:28:18AM +0200, Sebastian Huber wrote: If I destroy the barrier of the last team, and then initialize it later in gomp_new_team() +static inline struct gomp_team * +get_last_team (unsigned nthreads) +{ + struct gomp_thread *thr = gomp_thread (); + if (thr-ts.team == NULL) +{ + struct gomp_thread_pool *pool = thr-thread_pool; + if (pool != NULL) + { + struct gomp_team *last_team = pool-last_team; + if (last_team != NULL last_team-nthreads == nthreads) + { + pool-last_team = NULL; + gomp_barrier_destroy (last_team-barrier); + return last_team; + } + } +} + return NULL; +} then I get test suite failures. Is it safe to destroy the team barrier here or do we circumvent the last team mechanism which is supposed to delay the destruction? Then you indeed supposedly hit the reason why last_team exists. Thus, if not reinitializing the team barrier works even with --disable-linux-futex configured libgomp, I guess it is ok not to destroy it and reinit it again. The gomp_barrier_reinit() is only used for the pool-threads_dock barrier, but not for the team-barrier. I already test for last_team-nthreads == nthreads, so I don't think it makes sense to reinit, which uses an atomic operation on Linux. I run the test suite on x86_64-unknown-linux-gnu with the previously mentioned asserts and got no unexpected failures. With --disable-linux-futex (without asserts) I got several failures, but none of them is related to my patch, e.g. they are of the following type /tmp/ccw4RofR.o: In function `main': data-already-3.f:(.text+0x56): undefined reference to `acc_copyin_array_h_' === libgomp tests === Schedule of variations: unix Running target unix Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. Using /usr/share/dejagnu/config/unix.exp as generic interface file for target. Using /home/EB/sebastian_h/archive/gcc-git/libgomp/testsuite/config/default.exp as tool-and-target-specific interface file. Running /home/EB/sebastian_h/archive/gcc-git/libgomp/testsuite/libgomp.c/c.exp ... Running /home/EB/sebastian_h/archive/gcc-git/libgomp/testsuite/libgomp.c++/c++.exp ... Running /home/EB/sebastian_h/archive/gcc-git/libgomp/testsuite/libgomp.fortran/fortran.exp ... Running /home/EB/sebastian_h/archive/gcc-git/libgomp/testsuite/libgomp.graphite/graphite.exp ... Running /home/EB/sebastian_h/archive/gcc-git/libgomp/testsuite/libgomp.oacc-c/c.exp ... Running /home/EB/sebastian_h/archive/gcc-git/libgomp/testsuite/libgomp.oacc-c++/c++.exp ... Running /home/EB/sebastian_h/archive/gcc-git/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp ... FAIL: libgomp.oacc-fortran/acc_on_device-1-1.f90 -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O (test for excess errors) WARNING: libgomp.oacc-fortran/acc_on_device-1-1.f90 -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O compilation failed to produce executable FAIL: libgomp.oacc-fortran/acc_on_device-1-2.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O (test for excess errors) WARNING: libgomp.oacc-fortran/acc_on_device-1-2.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O compilation failed to produce executable FAIL: libgomp.oacc-fortran/acc_on_device-1-3.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O (test for excess errors) WARNING: libgomp.oacc-fortran/acc_on_device-1-3.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O compilation failed to produce executable FAIL: libgomp.oacc-fortran/data-already-1.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O (test for excess errors) WARNING: libgomp.oacc-fortran/data-already-1.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O compilation failed to produce executable FAIL: libgomp.oacc-fortran/data-already-3.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O (test for excess errors) WARNING: libgomp.oacc-fortran/data-already-3.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O compilation failed to produce executable FAIL: libgomp.oacc-fortran/data-already-4.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O (test for excess errors) WARNING: libgomp.oacc-fortran/data-already-4.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O compilation failed to produce executable FAIL: libgomp.oacc-fortran/data-already-5.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O (test for excess errors) WARNING: libgomp.oacc-fortran/data-already-5.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O compilation failed to produce executable FAIL: libgomp.oacc-fortran/data-already-6.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O (test for excess errors) WARNING: libgomp.oacc-fortran/data-already-6.f -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O compilation failed
[PATCH] [gomp] Recycle non-nested team if possible
Try to recycle the last non-nested team to avoid the use of malloc() and free() in the normal case where the number of threads is the same. Avoid superfluous destruction and initialization of team synchronization objects. Using the microbenchmark posted here https://gcc.gnu.org/ml/gcc-patches/2008-03/msg00930.html shows an improvement in the parallel bench test case (target x86_64-unknown-linux-gnu, median out of 9 test runs, iteration count increased to 20). Before the patch: parallel bench 11.2284 seconds After the patch: parallel bench 10.5912 seconds libgomp/ChangeLog 2015-07-13 Sebastian Huber sebastian.hu...@embedded-brains.de * team.c (get_recycable_team): New. (gomp_new_team): Recycle last non-nested team if possible. (free_team): Destroy more team synchronization objects. (gomp_team_end): Move some team synchronization object destructions to free_team(). --- libgomp/team.c | 54 +++--- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/libgomp/team.c b/libgomp/team.c index b98b233..0bcbaf8 100644 --- a/libgomp/team.c +++ b/libgomp/team.c @@ -134,6 +134,25 @@ gomp_thread_start (void *xdata) return NULL; } +static struct gomp_team * +get_recycable_team (unsigned nthreads) +{ + struct gomp_thread *thr = gomp_thread (); + if (thr-ts.team == NULL) +{ + struct gomp_thread_pool *pool = thr-thread_pool; + if (pool != NULL) + { + struct gomp_team *last_team = pool-last_team; + if (last_team != NULL last_team-nthreads == nthreads) + { + pool-last_team = NULL; + return last_team; + } + } +} + return NULL; +} /* Create a new team data structure. */ @@ -141,18 +160,28 @@ struct gomp_team * gomp_new_team (unsigned nthreads) { struct gomp_team *team; - size_t size; int i; - size = sizeof (*team) + nthreads * (sizeof (team-ordered_release[0]) - + sizeof (team-implicit_task[0])); - team = gomp_malloc (size); + team = get_recycable_team (nthreads); + if (team == NULL) +{ + size_t extra = sizeof (team-ordered_release[0]) + + sizeof (team-implicit_task[0]); + team = gomp_malloc (sizeof (*team) + nthreads * extra); + +#ifndef HAVE_SYNC_BUILTINS + gomp_mutex_init (team-work_share_list_free_lock); +#endif + gomp_barrier_init (team-barrier, nthreads); + gomp_sem_init (team-master_release, 0); + gomp_mutex_init (team-task_lock); + + team-nthreads = nthreads; +} team-work_share_chunk = 8; #ifdef HAVE_SYNC_BUILTINS team-single_count = 0; -#else - gomp_mutex_init (team-work_share_list_free_lock); #endif team-work_shares_to_free = team-work_shares[0]; gomp_init_work_share (team-work_shares[0], false, nthreads); @@ -163,14 +192,9 @@ gomp_new_team (unsigned nthreads) team-work_shares[i].next_free = team-work_shares[i + 1]; team-work_shares[i].next_free = NULL; - team-nthreads = nthreads; - gomp_barrier_init (team-barrier, nthreads); - - gomp_sem_init (team-master_release, 0); team-ordered_release = (void *) team-implicit_task[nthreads]; team-ordered_release[0] = team-master_release; - gomp_mutex_init (team-task_lock); team-task_queue = NULL; team-task_count = 0; team-task_queued_count = 0; @@ -187,6 +211,10 @@ gomp_new_team (unsigned nthreads) static void free_team (struct gomp_team *team) { + gomp_sem_destroy (team-master_release); +#ifndef HAVE_SYNC_BUILTINS + gomp_mutex_destroy (team-work_share_list_free_lock); +#endif gomp_barrier_destroy (team-barrier); gomp_mutex_destroy (team-task_lock); free (team); @@ -894,10 +922,6 @@ gomp_team_end (void) } while (ws != NULL); } - gomp_sem_destroy (team-master_release); -#ifndef HAVE_SYNC_BUILTINS - gomp_mutex_destroy (team-work_share_list_free_lock); -#endif if (__builtin_expect (thr-ts.team != NULL, 0) || __builtin_expect (team-nthreads == 1, 0)) -- 1.8.4.5
Re: [PATCH] [gomp] Recycle non-nested team if possible
On 13/07/15 16:17, Jakub Jelinek wrote: On Mon, Jul 13, 2015 at 01:15:44PM +0200, Sebastian Huber wrote: diff --git a/libgomp/team.c b/libgomp/team.c index b98b233..0bcbaf8 100644 --- a/libgomp/team.c +++ b/libgomp/team.c @@ -134,6 +134,25 @@ gomp_thread_start (void *xdata) return NULL; } +static struct gomp_team * +get_recycable_team (unsigned nthreads) That would be recyclable. But I think get_last_team would be better. Ok. Also, please make it static inline. Out of curiosity, does this make a difference for a static function in a module if it has the inline or not? + team = gomp_malloc (sizeof (*team) + nthreads * extra); + +#ifndef HAVE_SYNC_BUILTINS + gomp_mutex_init (team-work_share_list_free_lock); +#endif Avoiding gomp_mutex_destroy/gomp_mutex_init is fine, but I must say I'm far less sure about gomp_sem_init (can you add there a temporary assert that it has the expected value) and even less about gomp_barrier_init (I think e.g. on Linux generation will be very unlikely 0 that it should be, and not sure about awaited_final value either). Jakub I didn't observe any testsuite failures on x86_64-unknown-linux-gnu with this patch. I will add asserts and re-run the testsuite tomorrow. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] libgomp: Introduce gomp_thread::spare_team
Ping. On 07/07/15 14:17, Sebastian Huber wrote: Try to re-use the previous team to avoid the use of malloc() and free() in the normal case where number of threads is the same. Avoid superfluous destruction and initialization of team synchronization objects. Using the microbenchmark posted here https://gcc.gnu.org/ml/gcc-patches/2008-03/msg00930.html shows an improvement in the parallel bench test case (target x86_64-unknown-linux-gnu, median out of 9 test runs, iteration count increased to 20). Before the patch: parallel bench 11.2284 seconds After the patch: parallel bench 10.7575 seconds libgomp/ChangeLog 2015-07-07 Sebastian Huber sebastian.hu...@embedded-brains.de * libgomp.h (gomp_thread): Add spare_team field. * team.c (gomp_thread_start): Initialize spare team for non-TLS targets. (gomp_new_team): Use spare team if possible. (free_team): Destroy more team objects. (gomp_free_thread): Free spare team if necessary. (free_non_nested_team): New. (gomp_team_end): Move some team object destructions to free_team(). Use free_non_nested_team(). --- libgomp/libgomp.h | 3 +++ libgomp/team.c| 63 --- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h index 5ed0f78..563c1e2 100644 --- a/libgomp/libgomp.h +++ b/libgomp/libgomp.h @@ -448,6 +448,9 @@ struct gomp_thread /* User pthread thread pool */ struct gomp_thread_pool *thread_pool; + + /* Spare team ready for re-use in gomp_new_team() */ + struct gomp_team *spare_team; }; diff --git a/libgomp/team.c b/libgomp/team.c index b98b233..cc19eb0 100644 --- a/libgomp/team.c +++ b/libgomp/team.c @@ -77,6 +77,7 @@ gomp_thread_start (void *xdata) struct gomp_thread local_thr; thr = local_thr; pthread_setspecific (gomp_tls_key, thr); + thr-spare_team = NULL; #endif gomp_sem_init (thr-release, 0); @@ -140,19 +141,35 @@ gomp_thread_start (void *xdata) struct gomp_team * gomp_new_team (unsigned nthreads) { + struct gomp_thread *thr = gomp_thread (); + struct gomp_team *spare_team = thr-spare_team; struct gomp_team *team; - size_t size; int i; - size = sizeof (*team) + nthreads * (sizeof (team-ordered_release[0]) - + sizeof (team-implicit_task[0])); - team = gomp_malloc (size); + if (spare_team spare_team-nthreads == nthreads) +{ + thr-spare_team = NULL; + team = spare_team; +} + else +{ + size_t extra = sizeof (team-ordered_release[0]) + + sizeof (team-implicit_task[0]); + team = gomp_malloc (sizeof (*team) + nthreads * extra); + +#ifndef HAVE_SYNC_BUILTINS + gomp_mutex_init (team-work_share_list_free_lock); +#endif + gomp_barrier_init (team-barrier, nthreads); + gomp_sem_init (team-master_release, 0); + gomp_mutex_init (team-task_lock); + + team-nthreads = nthreads; +} team-work_share_chunk = 8; #ifdef HAVE_SYNC_BUILTINS team-single_count = 0; -#else - gomp_mutex_init (team-work_share_list_free_lock); #endif team-work_shares_to_free = team-work_shares[0]; gomp_init_work_share (team-work_shares[0], false, nthreads); @@ -163,14 +180,9 @@ gomp_new_team (unsigned nthreads) team-work_shares[i].next_free = team-work_shares[i + 1]; team-work_shares[i].next_free = NULL; - team-nthreads = nthreads; - gomp_barrier_init (team-barrier, nthreads); - - gomp_sem_init (team-master_release, 0); team-ordered_release = (void *) team-implicit_task[nthreads]; team-ordered_release[0] = team-master_release; - gomp_mutex_init (team-task_lock); team-task_queue = NULL; team-task_count = 0; team-task_queued_count = 0; @@ -187,6 +199,10 @@ gomp_new_team (unsigned nthreads) static void free_team (struct gomp_team *team) { + gomp_sem_destroy (team-master_release); +#ifndef HAVE_SYNC_BUILTINS + gomp_mutex_destroy (team-work_share_list_free_lock); +#endif gomp_barrier_destroy (team-barrier); gomp_mutex_destroy (team-task_lock); free (team); @@ -225,6 +241,8 @@ gomp_free_thread (void *arg __attribute__((unused))) { struct gomp_thread *thr = gomp_thread (); struct gomp_thread_pool *pool = thr-thread_pool; + if (thr-spare_team) +free_team (thr-spare_team); if (pool) { if (pool-threads_used 0) @@ -835,6 +853,18 @@ gomp_team_start (void (*fn) (void *), void *data, unsigned nthreads, free (affinity_thr); } +static void +free_non_nested_team (struct gomp_team *team, struct gomp_thread *thr) +{ + struct gomp_thread_pool *pool = thr-thread_pool; + if (pool-last_team) +{ + if (thr-spare_team) + free_team (thr-spare_team); + thr-spare_team = pool-last_team; +} + pool-last_team = team; +} /* Terminate the current team. This is only to be called by the master
Re: [PATCH] libgomp: Introduce gomp_thread::spare_team
On 13/07/15 09:17, Jakub Jelinek wrote: On Mon, Jul 13, 2015 at 08:32:33AM +0200, Sebastian Huber wrote: Ping. Space in gomp_thread is precious, that is a TLS variable, and you want to only handle the non-nested case only anyway, so why don't you just try to use if (thr-thread_pool) { struct gomp_thread *last_team = thr-thread_pool-last_team; if (last_team last_team-nthreads == nthreads) { team = last_team; thr-thread_pool-last_team = NULL; } } ? I started with this variant, but it needs one more if to check the thread pool. Since space seems to be more important, I will adjust the patch. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH] libgomp: Introduce gomp_thread::spare_team
Try to re-use the previous team to avoid the use of malloc() and free() in the normal case where number of threads is the same. Avoid superfluous destruction and initialization of team synchronization objects. Using the microbenchmark posted here https://gcc.gnu.org/ml/gcc-patches/2008-03/msg00930.html shows an improvement in the parallel bench test case (target x86_64-unknown-linux-gnu, median out of 9 test runs, iteration count increased to 20). Before the patch: parallel bench 11.2284 seconds After the patch: parallel bench 10.7575 seconds libgomp/ChangeLog 2015-07-07 Sebastian Huber sebastian.hu...@embedded-brains.de * libgomp.h (gomp_thread): Add spare_team field. * team.c (gomp_thread_start): Initialize spare team for non-TLS targets. (gomp_new_team): Use spare team if possible. (free_team): Destroy more team objects. (gomp_free_thread): Free spare team if necessary. (free_non_nested_team): New. (gomp_team_end): Move some team object destructions to free_team(). Use free_non_nested_team(). --- libgomp/libgomp.h | 3 +++ libgomp/team.c| 63 --- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h index 5ed0f78..563c1e2 100644 --- a/libgomp/libgomp.h +++ b/libgomp/libgomp.h @@ -448,6 +448,9 @@ struct gomp_thread /* User pthread thread pool */ struct gomp_thread_pool *thread_pool; + + /* Spare team ready for re-use in gomp_new_team() */ + struct gomp_team *spare_team; }; diff --git a/libgomp/team.c b/libgomp/team.c index b98b233..cc19eb0 100644 --- a/libgomp/team.c +++ b/libgomp/team.c @@ -77,6 +77,7 @@ gomp_thread_start (void *xdata) struct gomp_thread local_thr; thr = local_thr; pthread_setspecific (gomp_tls_key, thr); + thr-spare_team = NULL; #endif gomp_sem_init (thr-release, 0); @@ -140,19 +141,35 @@ gomp_thread_start (void *xdata) struct gomp_team * gomp_new_team (unsigned nthreads) { + struct gomp_thread *thr = gomp_thread (); + struct gomp_team *spare_team = thr-spare_team; struct gomp_team *team; - size_t size; int i; - size = sizeof (*team) + nthreads * (sizeof (team-ordered_release[0]) - + sizeof (team-implicit_task[0])); - team = gomp_malloc (size); + if (spare_team spare_team-nthreads == nthreads) +{ + thr-spare_team = NULL; + team = spare_team; +} + else +{ + size_t extra = sizeof (team-ordered_release[0]) + + sizeof (team-implicit_task[0]); + team = gomp_malloc (sizeof (*team) + nthreads * extra); + +#ifndef HAVE_SYNC_BUILTINS + gomp_mutex_init (team-work_share_list_free_lock); +#endif + gomp_barrier_init (team-barrier, nthreads); + gomp_sem_init (team-master_release, 0); + gomp_mutex_init (team-task_lock); + + team-nthreads = nthreads; +} team-work_share_chunk = 8; #ifdef HAVE_SYNC_BUILTINS team-single_count = 0; -#else - gomp_mutex_init (team-work_share_list_free_lock); #endif team-work_shares_to_free = team-work_shares[0]; gomp_init_work_share (team-work_shares[0], false, nthreads); @@ -163,14 +180,9 @@ gomp_new_team (unsigned nthreads) team-work_shares[i].next_free = team-work_shares[i + 1]; team-work_shares[i].next_free = NULL; - team-nthreads = nthreads; - gomp_barrier_init (team-barrier, nthreads); - - gomp_sem_init (team-master_release, 0); team-ordered_release = (void *) team-implicit_task[nthreads]; team-ordered_release[0] = team-master_release; - gomp_mutex_init (team-task_lock); team-task_queue = NULL; team-task_count = 0; team-task_queued_count = 0; @@ -187,6 +199,10 @@ gomp_new_team (unsigned nthreads) static void free_team (struct gomp_team *team) { + gomp_sem_destroy (team-master_release); +#ifndef HAVE_SYNC_BUILTINS + gomp_mutex_destroy (team-work_share_list_free_lock); +#endif gomp_barrier_destroy (team-barrier); gomp_mutex_destroy (team-task_lock); free (team); @@ -225,6 +241,8 @@ gomp_free_thread (void *arg __attribute__((unused))) { struct gomp_thread *thr = gomp_thread (); struct gomp_thread_pool *pool = thr-thread_pool; + if (thr-spare_team) +free_team (thr-spare_team); if (pool) { if (pool-threads_used 0) @@ -835,6 +853,18 @@ gomp_team_start (void (*fn) (void *), void *data, unsigned nthreads, free (affinity_thr); } +static void +free_non_nested_team (struct gomp_team *team, struct gomp_thread *thr) +{ + struct gomp_thread_pool *pool = thr-thread_pool; + if (pool-last_team) +{ + if (thr-spare_team) + free_team (thr-spare_team); + thr-spare_team = pool-last_team; +} + pool-last_team = team; +} /* Terminate the current team. This is only to be called by the master thread. We assume that we must wait for the other threads. */ @@ -894,21 +924,12 @@ gomp_team_end (void
[PATCH] libgomp: Add comment to clarify last_team usage
libgomp/ChangeLog 2015-07-03 Sebastian Huber sebastian.hu...@embedded-brains.de * libgomp.h (gomp_thread_pool): Comment last_team field. --- libgomp/libgomp.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h index 5272f01..5ed0f78 100644 --- a/libgomp/libgomp.h +++ b/libgomp/libgomp.h @@ -458,6 +458,9 @@ struct gomp_thread_pool struct gomp_thread **threads; unsigned threads_size; unsigned threads_used; + /* The last team is used for non-nested teams to delay their destruction to + make sure all the threads in the team move on to the pool's barrier before + the team's barrier is destroyed. */ struct gomp_team *last_team; /* Number of threads running in this contention group. */ unsigned long threads_busy; -- 1.8.4.5
Re: [PATCH] Make muser-mode the default for LEON3
Instead of introducing a new option which may conflict with an existing one, is it not possible to simply use -mno-user-mode? On 23/06/15 14:22, Daniel Cederman wrote: The muser-mode flag causes the CASA instruction for LEON3 to use the user mode ASI. This is the correct behavior for almost all LEON3 targets. For this reason it makes sense to make user mode the default. This patch adds a flag for supervisor mode that can be used on the very few LEON3 targets that requires CASA to use the supervisor ASI. gcc/ChangeLog: 2015-06-22 Daniel Cederman ceder...@gaisler.com * config/sparc/sparc.opt: Add supervisor mode flag (-msv-mode) and make user mode the default * config/sparc/sync.md: Only use supervisor ASI for CASA when in supervisor mode * doc/invoke.texi: Document msv-mode flag -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] libgomp: Add RTEMS support
On 13/03/15 11:43, Jakub Jelinek wrote: On Fri, Mar 13, 2015 at 11:38:12AM +0100, Sebastian Huber wrote: I would like to commit this patch to GCC 4.9 and 5.0. libgomp/ChangeLog 2015-03-13 Sebastian Huber sebastian.hu...@embedded-brains.de * configure.tgt (*-*-rtems*): Use local-exec TLS model. * configure.ac (*-*-rtems*): Assume Pthread is supported. (pthread.h): Check for this header file. * configure: Regenerate. Ok for trunk. Please wait with the backports for a few weeks. May I back port this patch now? It would be nice to have it available in GCC 4.9.3. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH] libgomp: Add RTEMS support
I would like to commit this patch to GCC 4.9 and 5.0. libgomp/ChangeLog 2015-03-13 Sebastian Huber sebastian.hu...@embedded-brains.de * configure.tgt (*-*-rtems*): Use local-exec TLS model. * configure.ac (*-*-rtems*): Assume Pthread is supported. (pthread.h): Check for this header file. * configure: Regenerate. --- libgomp/configure | 22 ++ libgomp/configure.ac | 42 -- libgomp/configure.tgt | 4 3 files changed, 42 insertions(+), 26 deletions(-) diff --git a/libgomp/configure b/libgomp/configure index 0818707..e39787c 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -14611,7 +14611,7 @@ $as_echo #define STRING_WITH_STRINGS 1 confdefs.h fi -for ac_header in unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h +for ac_header in pthread.h unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h do : as_ac_Header=`$as_echo ac_cv_header_$ac_header | $as_tr_sh` ac_fn_c_check_header_mongrel $LINENO $ac_header $as_ac_Header $ac_includes_default @@ -15033,14 +15033,19 @@ ac_config_commands=$ac_config_commands gstdint.h -# Check to see if -pthread or -lpthread is needed. Prefer the former. -# In case the pthread.h system header is not found, this test will fail. XPCFLAGS= -CFLAGS=$CFLAGS -pthread -cat confdefs.h - _ACEOF conftest.$ac_ext +case $host in + *-*-rtems*) +# RTEMS supports Pthreads, but the library is not available at GCC build time. +;; + *) +# Check to see if -pthread or -lpthread is needed. Prefer the former. +# In case the pthread.h system header is not found, this test will fail. +CFLAGS=$CFLAGS -pthread +cat confdefs.h - _ACEOF conftest.$ac_ext /* end confdefs.h. */ #include pthread.h - void *g(void *d) { return NULL; } + void *g(void *d) { return NULL; } int main () { @@ -15053,10 +15058,10 @@ if ac_fn_c_try_link $LINENO; then : XPCFLAGS= -Wc,-pthread else CFLAGS=$save_CFLAGS LIBS=-lpthread $LIBS - cat confdefs.h - _ACEOF conftest.$ac_ext + cat confdefs.h - _ACEOF conftest.$ac_ext /* end confdefs.h. */ #include pthread.h - void *g(void *d) { return NULL; } + void *g(void *d) { return NULL; } int main () { @@ -15075,6 +15080,7 @@ rm -f core conftest.err conftest.$ac_objext \ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +esac # Plugins for offload execution, configure.ac fragment. -*- mode: autoconf -*- # diff --git a/libgomp/configure.ac b/libgomp/configure.ac index 4687b01..51e646d 100644 --- a/libgomp/configure.ac +++ b/libgomp/configure.ac @@ -170,28 +170,34 @@ AC_SUBST(libtool_VERSION) AC_STDC_HEADERS AC_HEADER_TIME ACX_HEADER_STRING -AC_CHECK_HEADERS(unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h) +AC_CHECK_HEADERS(pthread.h unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h) GCC_HEADER_STDINT(gstdint.h) -# Check to see if -pthread or -lpthread is needed. Prefer the former. -# In case the pthread.h system header is not found, this test will fail. XPCFLAGS= -CFLAGS=$CFLAGS -pthread -AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include pthread.h - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(t,NULL,g,NULL);])], - [XPCFLAGS= -Wc,-pthread], - [CFLAGS=$save_CFLAGS LIBS=-lpthread $LIBS - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( -[#include pthread.h - void *g(void *d) { return NULL; }], -[pthread_t t; pthread_create(t,NULL,g,NULL);])], - [], - [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) +case $host in + *-*-rtems*) +# RTEMS supports Pthreads, but the library is not available at GCC build time. +;; + *) +# Check to see if -pthread or -lpthread is needed. Prefer the former. +# In case the pthread.h system header is not found, this test will fail. +CFLAGS=$CFLAGS -pthread +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include pthread.h + void *g(void *d) { return NULL; }], + [pthread_t t; pthread_create(t,NULL,g,NULL);])], + [XPCFLAGS= -Wc,-pthread], + [CFLAGS=$save_CFLAGS LIBS=-lpthread $LIBS + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( +[#include pthread.h + void *g(void *d) { return NULL; }], +[pthread_t t; pthread_create(t,NULL,g,NULL);])], + [], + [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) +esac m4_include([plugin/configfrag.ac]) diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt index ad98de1..2970f6f 100644 --- a/libgomp/configure.tgt +++ b/libgomp/configure.tgt @@ -20,6 +20,10 @@ if test $gcc_cv_have_tls = yes ; then *-*-linux* | *-*-gnu*) XCFLAGS=${XCFLAGS} -ftls-model=initial-exec ;; + +*-*-rtems*) + XCFLAGS=${XCFLAGS} -ftls-model=local-exec + ;; esac fi -- 1.8.4.5
Re: [PATCH] libgomp: Add RTEMS support
On 13/03/15 11:43, Jakub Jelinek wrote: On Fri, Mar 13, 2015 at 11:38:12AM +0100, Sebastian Huber wrote: I would like to commit this patch to GCC 4.9 and 5.0. libgomp/ChangeLog 2015-03-13 Sebastian Huber sebastian.hu...@embedded-brains.de * configure.tgt (*-*-rtems*): Use local-exec TLS model. * configure.ac (*-*-rtems*): Assume Pthread is supported. (pthread.h): Check for this header file. * configure: Regenerate. Ok for trunk. Please wait with the backports for a few weeks. Thanks for the quick review. I checked it in to trunk. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH 1/3] RTEMS: Use MULTILIB_REQUIRED for PowerPC
Checked in as https://gcc.gnu.org/viewcvs/gcc?view=revisionrevision=219384 https://gcc.gnu.org/viewcvs/gcc?view=revisionrevision=219389 -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH 2/3] RTEMS: Fix MPC8540 multilibs for PowerPC
Checked in as https://gcc.gnu.org/viewcvs/gcc?view=revisionrevision=219385 https://gcc.gnu.org/viewcvs/gcc?view=revisionrevision=219390 -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH 3/3] RTEMS: Add e6500 multilibs for PowerPC
Checked in slightly modified as https://gcc.gnu.org/viewcvs/gcc?view=revisionrevision=219387 https://gcc.gnu.org/viewcvs/gcc?view=revisionrevision=219391 -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH 1/2] RTEMS: Rename ARM target config files
Checked in as https://gcc.gnu.org/viewcvs/gcc?view=revisionrevision=219382 -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH 2/2] RTEMS: Use MULTILIB_REQUIRED for ARM
Checked in as https://gcc.gnu.org/viewcvs/gcc?view=revisionrevision=219383 -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH 2/2] RTEMS: Use MULTILIB_REQUIRED for ARM
This patch should be applied to GCC mainline. I do not have write access, so in case this gets approved, please commit it for me. gcc/ChangeLog 2014-12-15 Sebastian Huber sebastian.hu...@embedded-brains.de * config/arm/t-rtems: Use MULTILIB_REQUIRED instead of MULTILIB_EXCEPTIONS. --- gcc/config/arm/t-rtems | 173 - 1 file changed, 13 insertions(+), 160 deletions(-) diff --git a/gcc/config/arm/t-rtems b/gcc/config/arm/t-rtems index 92c4dcb..3b62181 100644 --- a/gcc/config/arm/t-rtems +++ b/gcc/config/arm/t-rtems @@ -1,4 +1,4 @@ -# Custom RTEMS EABI multilibs +# Custom RTEMS multilibs for ARM MULTILIB_OPTIONS = mbig-endian mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon/mfpu=vfpv3-d16/mfpu=fpv4-sp-d16 mfloat-abi=hard MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 fpv4-sp-d16 hard @@ -6,162 +6,15 @@ MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 fpv4 # Enumeration of multilibs MULTILIB_EXCEPTIONS = -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16 -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16 -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16 -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16 -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon -# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16 -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16 -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfloat-abi=hard -# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16 -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16 -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16 -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16 -MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/mthumb -MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon -MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16 -MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16 -MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m -MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon -MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16 -MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard -MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=fpv4-sp-d16
[PATCH 1/2] RTEMS: Rename ARM target config files
Now that we only have the EABI configuration for RTEMS rename the files to match the pattern used for the other RTEMS targets. This patch should be applied to GCC mainline. I do not have write access, so in case this gets approved, please commit it for me. gcc/ChangeLog 2014-12-15 Sebastian Huber sebastian.hu...@embedded-brains.de * config/arm/t-rtems-eabi: Rename to... * config/arm/t-rtems: ...this. * config/arm/rtems-eabi.h: Rename to... * config/arm/rtems.h: ...this. * config.gcc (arm*-*-rtems*): Reflect changes above. --- gcc/config.gcc | 4 +- gcc/config/arm/rtems-eabi.h | 29 gcc/config/arm/rtems.h | 29 gcc/config/arm/t-rtems | 167 gcc/config/arm/t-rtems-eabi | 167 5 files changed, 198 insertions(+), 198 deletions(-) delete mode 100644 gcc/config/arm/rtems-eabi.h create mode 100644 gcc/config/arm/rtems.h create mode 100644 gcc/config/arm/t-rtems delete mode 100644 gcc/config/arm/t-rtems-eabi diff --git a/gcc/config.gcc b/gcc/config.gcc index 8541274..e49bcbd 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1057,8 +1057,8 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems*) use_gcc_stdint=wrap ;; arm*-*-rtems*) - tm_file=${tm_file} rtems.h arm/rtems-eabi.h newlib-stdint.h - tmake_file=${tmake_file} arm/t-bpabi arm/t-rtems-eabi + tm_file=${tm_file} rtems.h arm/rtems.h newlib-stdint.h + tmake_file=${tmake_file} arm/t-bpabi arm/t-rtems ;; arm*-*-symbianelf*) tm_file=${tm_file} arm/symbian.h diff --git a/gcc/config/arm/rtems-eabi.h b/gcc/config/arm/rtems-eabi.h deleted file mode 100644 index 4bdcf0d..000 --- a/gcc/config/arm/rtems-eabi.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Definitions for RTEMS based ARM systems using EABI. - Copyright (C) 2011-2014 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. - - GCC is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING3. If not see - http://www.gnu.org/licenses/. */ - -#define HAS_INIT_SECTION - -#undef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ -do { \ - builtin_define (__rtems__); \ - builtin_define (__USE_INIT_FINI__); \ - builtin_assert (system=rtems);\ - TARGET_BPABI_CPP_BUILTINS();\ -} while (0) diff --git a/gcc/config/arm/rtems.h b/gcc/config/arm/rtems.h new file mode 100644 index 000..4bdcf0d --- /dev/null +++ b/gcc/config/arm/rtems.h @@ -0,0 +1,29 @@ +/* Definitions for RTEMS based ARM systems using EABI. + Copyright (C) 2011-2014 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + http://www.gnu.org/licenses/. */ + +#define HAS_INIT_SECTION + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ +do { \ + builtin_define (__rtems__); \ + builtin_define (__USE_INIT_FINI__); \ + builtin_assert (system=rtems);\ + TARGET_BPABI_CPP_BUILTINS();\ +} while (0) diff --git a/gcc/config/arm/t-rtems b/gcc/config/arm/t-rtems new file mode 100644 index 000..92c4dcb --- /dev/null +++ b/gcc/config/arm/t-rtems @@ -0,0 +1,167 @@ +# Custom RTEMS EABI multilibs + +MULTILIB_OPTIONS = mbig-endian mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon/mfpu=vfpv3-d16/mfpu=fpv4-sp-d16 mfloat-abi=hard +MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 fpv4-sp-d16 hard + +# Enumeration of multilibs + +MULTILIB_EXCEPTIONS = +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig
[PATCH 3/3] RTEMS: Add e6500 multilibs for PowerPC
Use 32-bit instructions only since currenlty there is no demand for a larger address space. Provide one multilib with FPU and AltiVec support and one without. This patch should be applied to GCC 4.9 and mainline. I do not have write access, so in case this gets approved, please commit it for me. gcc/ChangeLog 2014-12-15 Sebastian Huber sebastian.hu...@embedded-brains.de * config/rs6000/t-rtems: Add e6500 multilibs. --- gcc/config/rs6000/t-rtems | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gcc/config/rs6000/t-rtems b/gcc/config/rs6000/t-rtems index e935947..128ea3e 100644 --- a/gcc/config/rs6000/t-rtems +++ b/gcc/config/rs6000/t-rtems @@ -24,14 +24,17 @@ MULTILIB_MATCHES = MULTILIB_EXCEPTIONS = MULTILIB_REQUIRED = -MULTILIB_OPTIONS += mcpu=403/mcpu=505/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400/mcpu=8540 -MULTILIB_DIRNAMES += m403 m505 m603e m604 m860 m7400 m8540 +MULTILIB_OPTIONS += mcpu=403/mcpu=505/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400/mcpu=8540/mcpu=e6500 +MULTILIB_DIRNAMES += m403 m505 m603e m604 m860 m7400 m8540 me6500 MULTILIB_OPTIONS += msoft-float/mfloat-gprs=double MULTILIB_DIRNAMES += nof gprsdouble -MULTILIB_OPTIONS += mno-spe -MULTILIB_DIRNAMES += nospe +MULTILIB_OPTIONS += mno-spe/mno-altivec +MULTILIB_DIRNAMES += nospe noaltivec + +MULTILIB_OPTIONS += m32 +MULTILIB_DIRNAMES += m32 MULTILIB_MATCHES += ${MULTILIB_MATCHES_ENDIAN} MULTILIB_MATCHES += ${MULTILIB_MATCHES_SYSV} @@ -72,3 +75,5 @@ MULTILIB_REQUIRED += mcpu=8540 MULTILIB_REQUIRED += mcpu=8540/msoft-float/mno-spe MULTILIB_REQUIRED += mcpu=8540/mfloat-gprs=double MULTILIB_REQUIRED += mcpu=860 +MULTILIB_REQUIRED += mcpu=e6500/m32 +MULTILIB_REQUIRED += mcpu=e6500/m32/msoft-float/mno-altivec -- 1.8.4.5
[PATCH 2/3] RTEMS: Fix MPC8540 multilibs for PowerPC
GCC generates SPE instructions even if -msoft-float is specified. Explicitly add -mno-spe to prevent generation of SPE instructions. This multilib variant must not lead to a usage of the SPE. This patch should be applied to GCC 4.9 and mainline. I do not have write access, so in case this gets approved, please commit it for me. gcc/ChangeLog 2014-12-15 Sebastian Huber sebastian.hu...@embedded-brains.de * config/rs6000/t-rtems: Add -mno-spe to soft-float multilib for MPC8540. --- gcc/config/rs6000/t-rtems | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/config/rs6000/t-rtems b/gcc/config/rs6000/t-rtems index 3ebcfaa..e935947 100644 --- a/gcc/config/rs6000/t-rtems +++ b/gcc/config/rs6000/t-rtems @@ -30,6 +30,9 @@ MULTILIB_DIRNAMES += m403 m505 m603e m604 m860 m7400 m8540 MULTILIB_OPTIONS += msoft-float/mfloat-gprs=double MULTILIB_DIRNAMES += nof gprsdouble +MULTILIB_OPTIONS += mno-spe +MULTILIB_DIRNAMES += nospe + MULTILIB_MATCHES += ${MULTILIB_MATCHES_ENDIAN} MULTILIB_MATCHES += ${MULTILIB_MATCHES_SYSV} # Map 405 to 403 @@ -66,6 +69,6 @@ MULTILIB_REQUIRED += mcpu=604/msoft-float MULTILIB_REQUIRED += mcpu=7400 MULTILIB_REQUIRED += mcpu=7400/msoft-float MULTILIB_REQUIRED += mcpu=8540 -MULTILIB_REQUIRED += mcpu=8540/msoft-float +MULTILIB_REQUIRED += mcpu=8540/msoft-float/mno-spe MULTILIB_REQUIRED += mcpu=8540/mfloat-gprs=double MULTILIB_REQUIRED += mcpu=860 -- 1.8.4.5
[PATCH 1/3] RTEMS: Use MULTILIB_REQUIRED for PowerPC
This patch should be applied to GCC 4.9 and mainline. I do not have write access, so in case this gets approved, please commit it for me. gcc/ChangeLog 2014-12-15 Sebastian Huber sebastian.hu...@embedded-brains.de * config/rs6000/t-rtems: Use MULTILIB_REQUIRED instead of MULTILIB_EXCEPTIONS. --- gcc/config/rs6000/t-rtems | 65 +-- 1 file changed, 24 insertions(+), 41 deletions(-) diff --git a/gcc/config/rs6000/t-rtems b/gcc/config/rs6000/t-rtems index 426f75a..3ebcfaa 100644 --- a/gcc/config/rs6000/t-rtems +++ b/gcc/config/rs6000/t-rtems @@ -18,16 +18,18 @@ # along with GCC; see the file COPYING3. If not see # http://www.gnu.org/licenses/. -MULTILIB_OPTIONS = \ -mcpu=403/mcpu=505/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400/mcpu=8540 \ -msoft-float/mfloat-gprs=double +MULTILIB_OPTIONS = +MULTILIB_DIRNAMES = +MULTILIB_MATCHES = +MULTILIB_EXCEPTIONS = +MULTILIB_REQUIRED = + +MULTILIB_OPTIONS += mcpu=403/mcpu=505/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400/mcpu=8540 +MULTILIB_DIRNAMES += m403 m505 m603e m604 m860 m7400 m8540 -MULTILIB_DIRNAMES = \ -m403 m505 m603e m604 m860 m7400 m8540 \ -nof gprsdouble +MULTILIB_OPTIONS += msoft-float/mfloat-gprs=double +MULTILIB_DIRNAMES += nof gprsdouble -# MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT} -MULTILIB_MATCHES = MULTILIB_MATCHES += ${MULTILIB_MATCHES_ENDIAN} MULTILIB_MATCHES += ${MULTILIB_MATCHES_SYSV} # Map 405 to 403 @@ -52,37 +54,18 @@ MULTILIB_MATCHES+= mcpu?8540=mcpu?8548 # (mfloat-gprs=single is implicit default) MULTILIB_MATCHES += mcpu?8540=mcpu?8540/mfloat-gprs?single -# Soft-float only, default implies msoft-float -# NOTE: Must match with MULTILIB_MATCHES_FLOAT and MULTILIB_MATCHES -MULTILIB_SOFTFLOAT_ONLY = \ -*mcpu=401/*msoft-float* \ -*mcpu=403/*msoft-float* \ -*mcpu=405/*msoft-float* \ -*mcpu=801/*msoft-float* \ -*mcpu=821/*msoft-float* \ -*mcpu=823/*msoft-float* \ -*mcpu=860/*msoft-float* - -# Hard-float only, take out msoft-float -MULTILIB_HARDFLOAT_ONLY = \ -*mcpu=505/*msoft-float* - -# Targets which do not support gprs -MULTILIB_NOGPRS = \ -mfloat-gprs=* \ -*mcpu=403/*mfloat-gprs=* \ -*mcpu=505/*mfloat-gprs=* \ -*mcpu=603e/*mfloat-gprs=* \ -*mcpu=604/*mfloat-gprs=* \ -*mcpu=860/*mfloat-gprs=* \ -*mcpu=7400/*mfloat-gprs=* - -MULTILIB_EXCEPTIONS = - -# Disallow -Dppc and -Dmpc without other options -MULTILIB_EXCEPTIONS+= Dppc* Dmpc* +# Enumeration of multilibs -MULTILIB_EXCEPTIONS+= \ -${MULTILIB_SOFTFLOAT_ONLY} \ -${MULTILIB_HARDFLOAT_ONLY} \ -${MULTILIB_NOGPRS} +MULTILIB_REQUIRED += msoft-float +MULTILIB_REQUIRED += mcpu=403 +MULTILIB_REQUIRED += mcpu=505 +MULTILIB_REQUIRED += mcpu=603e +MULTILIB_REQUIRED += mcpu=603e/msoft-float +MULTILIB_REQUIRED += mcpu=604 +MULTILIB_REQUIRED += mcpu=604/msoft-float +MULTILIB_REQUIRED += mcpu=7400 +MULTILIB_REQUIRED += mcpu=7400/msoft-float +MULTILIB_REQUIRED += mcpu=8540 +MULTILIB_REQUIRED += mcpu=8540/msoft-float +MULTILIB_REQUIRED += mcpu=8540/mfloat-gprs=double +MULTILIB_REQUIRED += mcpu=860 -- 1.8.4.5
[PATCH v2] RTEMS: Add e6500 multilibs for PowerPC
Use 32-bit instructions only since currenlty there is no demand for a larger address space. Provide one multilib with FPU and AltiVec support and one without. This patch should be applied to GCC 4.9 and mainline. I do not have write access, so in case this gets approved, please commit it for me. v2: Move MULTILIB_OPTIONS += m32 to right position in the file. gcc/ChangeLog 2014-12-15 Sebastian Huber sebastian.hu...@embedded-brains.de * config/rs6000/t-rtems: Add e6500 multilibs. --- gcc/config/rs6000/t-rtems | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gcc/config/rs6000/t-rtems b/gcc/config/rs6000/t-rtems index e935947..eadda0d 100644 --- a/gcc/config/rs6000/t-rtems +++ b/gcc/config/rs6000/t-rtems @@ -24,14 +24,17 @@ MULTILIB_MATCHES = MULTILIB_EXCEPTIONS = MULTILIB_REQUIRED = -MULTILIB_OPTIONS += mcpu=403/mcpu=505/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400/mcpu=8540 -MULTILIB_DIRNAMES += m403 m505 m603e m604 m860 m7400 m8540 +MULTILIB_OPTIONS += mcpu=403/mcpu=505/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400/mcpu=8540/mcpu=e6500 +MULTILIB_DIRNAMES += m403 m505 m603e m604 m860 m7400 m8540 me6500 + +MULTILIB_OPTIONS += m32 +MULTILIB_DIRNAMES += m32 MULTILIB_OPTIONS += msoft-float/mfloat-gprs=double MULTILIB_DIRNAMES += nof gprsdouble -MULTILIB_OPTIONS += mno-spe -MULTILIB_DIRNAMES += nospe +MULTILIB_OPTIONS += mno-spe/mno-altivec +MULTILIB_DIRNAMES += nospe noaltivec MULTILIB_MATCHES += ${MULTILIB_MATCHES_ENDIAN} MULTILIB_MATCHES += ${MULTILIB_MATCHES_SYSV} @@ -72,3 +75,5 @@ MULTILIB_REQUIRED += mcpu=8540 MULTILIB_REQUIRED += mcpu=8540/msoft-float/mno-spe MULTILIB_REQUIRED += mcpu=8540/mfloat-gprs=double MULTILIB_REQUIRED += mcpu=860 +MULTILIB_REQUIRED += mcpu=e6500/m32 +MULTILIB_REQUIRED += mcpu=e6500/m32/msoft-float/mno-altivec -- 1.8.4.5
[PATCH] gcc/testsuite/gcc.dg/typeof-2.c
gcc/testsuite/ChangeLog 2014-12-15 Sebastian Huber sebastian.hu...@embedded-brains.de * gcc.dg/typeof-2.c: Add checks for non-atomic types. --- gcc/testsuite/gcc.dg/typeof-2.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/gcc/testsuite/gcc.dg/typeof-2.c b/gcc/testsuite/gcc.dg/typeof-2.c index e916900..21ef5b0 100644 --- a/gcc/testsuite/gcc.dg/typeof-2.c +++ b/gcc/testsuite/gcc.dg/typeof-2.c @@ -2,6 +2,8 @@ /* { dg-do compile } */ /* { dg-options -std=c11 } */ +/* Check that the qualifiers are discarded for atomic types. */ + extern int i; extern int * p; @@ -26,3 +28,32 @@ void f(void) __auto_type ari = ri; int **pari = ari; } + +/* Check that the qualifiers are preserved for non-atomic types. */ + +extern int const j; + +extern int volatile k; + +extern int * restrict q; + +extern int const nci; +extern __typeof (nci) j; + +extern int volatile nvi; +extern __typeof (nvi) k; + +extern int * restrict nri; +extern __typeof (nri) q; + +void g(void) +{ + __auto_type aci = nci; + int const *paci = aci; + + __auto_type avi = nvi; + int volatile *pavi = avi; + + __auto_type ari = nri; + int * restrict *pari = ari; +} -- 1.8.4.5
Re: [PATCH] RTEMS: select SPARC multilibs
Hello Daniel, thanks for the patch. On 06/11/14 16:36, Daniel Hellstrom wrote: Recent support for mcpu=leon3v7 and muser-mode were added to GCC. Update the RTEMS multilib for sparc to the following combinations: v7- ./ leon3 muser-mode - leon3/user-mode/ leon3v7 muser-mode- leon3v7/user-mode/ v8- v8/ v7 soft-float - soft/ leon3 soft-float muser-mode - soft/leon3/user-mode/ leon3v7 soft-float muser-mode - soft/leon3v7/user-mode/ v8 soft-float - soft/v8/ I think this would be good for 4.8, 4.9 and trunk. 2014-11-06 Daniel Hellstromdan...@gaisler.com * config.gcc (sparc-*-rtems*): Clean away unused t-elf * config/sparc/t-rtems: Add leon3v7 and muser-mode multilibs I tested this patch with the GCC 4.9 branch and it yields exactly the set of multilibs we need in RTEMS to support the currently available hardware. I compiled the RTEMS testsuite with this compiler and run it on an NGMP board. The results are all right. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] RTEMS thread model configuration
Ping^2. On 02/05/14 10:46, Sebastian Huber wrote: Ping. On 2014-04-18 12:11, Sebastian Huber wrote: From: Sebastian Huber sebastian-hu...@web.de The command line to build a GCC for RTEMS contained virtually always a '--enable-threads'. This patch helps to avoid this extra configuration command line parameter and makes the GCC build a bit more user friendly for RTEMS. This patch should be applied to GCC 4.9 branch and master. 2014-04-18 Sebastian Huber sebastian.hu...@embedded-brains.de * config.gcc (*-*-rtems*): Default to 'rtems' thread model. Enable selection of 'posix' or no thread model. --- gcc/config.gcc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 3c55c88..93d5994 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -791,7 +791,13 @@ case ${target} in ;; *-*-rtems*) case ${enable_threads} in -yes) thread_file='rtems' ;; + | yes | rtems) thread_file='rtems' ;; +posix) thread_file='posix' ;; +no) ;; +*) + echo 'Unknown thread configuration for RTEMS' + exit 1 + ;; esac tmake_file=${tmake_file} t-rtems extra_options=${extra_options} rtems.opt -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH] RTEMS: Update contrib/config-list.mk
contrib/ChangeLog 2014-09-17 Sebastian Huber sebastian.hu...@embedded-brains.de * config-list.mk (LIST): Add arm-rtems. Add nios2-rtems. Remove extra option from powerpc-rtems. --- contrib/config-list.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/config-list.mk b/contrib/config-list.mk index 4345487..056fbf0 100644 --- a/contrib/config-list.mk +++ b/contrib/config-list.mk @@ -17,7 +17,7 @@ LIST = aarch64-elf aarch64-linux-gnu \ arc-elf32OPT-with-cpu=arc600 arc-elf32OPT-with-cpu=arc700 \ arc-linux-uclibcOPT-with-cpu=arc700 arceb-linux-uclibcOPT-with-cpu=arc700 \ arm-wrs-vxworks arm-netbsdelf \ - arm-linux-androideabi arm-uclinux_eabi arm-eabi \ + arm-linux-androideabi arm-uclinux_eabi arm-eabi arm-rtems \ arm-symbianelf avr-rtems avr-elf \ bfin-elf bfin-uclinux bfin-linux-uclibc bfin-rtems bfin-openbsd \ c6x-elf c6x-uclinux cr16-elf cris-elf cris-linux crisv32-elf crisv32-linux \ @@ -48,13 +48,13 @@ LIST = aarch64-elf aarch64-linux-gnu \ moxie-uclinux moxie-rtems \ msp430-elf \ nds32le-elf nds32be-elf \ - nios2-elf nios2-linux-gnu \ + nios2-elf nios2-linux-gnu nios2-rtems \ pdp11-aout picochip-elfOPT-enable-obsolete \ powerpc-darwin8 \ powerpc-darwin7 powerpc64-darwin powerpc-freebsd6 powerpc-netbsd \ powerpc-eabispe powerpc-eabisimaltivec powerpc-eabisim ppc-elf \ powerpc-eabialtivec powerpc-xilinx-eabi powerpc-eabi \ - powerpc-rtems4.11OPT-enable-threads=yes powerpc-linux_spe \ + powerpc-rtems powerpc-linux_spe \ powerpc-linux_paired powerpc64-linux_altivec \ powerpc-wrs-vxworks powerpc-wrs-vxworksae powerpc-lynxos powerpcle-elf \ powerpcle-eabisim powerpcle-eabi rs6000-ibm-aix4.3 rs6000-ibm-aix5.1.0 \ -- 1.8.4.5
Re: [PATCH] RTEMS: Update contrib/config-list.mk
On 09/17/2014 04:45 PM, Jan-Benedict Glaw wrote: On Wed, 2014-09-17 15:37:32 +0200, Sebastian Hubersebastian.hu...@embedded-brains.de wrote: contrib/ChangeLog 2014-09-17 Sebastian Hubersebastian.hu...@embedded-brains.de * config-list.mk (LIST): Add arm-rtems. Add nios2-rtems. Remove extra option from powerpc-rtems. What's the rationale for removing --enable-threads=yes here, as well as the specific version number? The version number can be arbitrary. All the other RTEMS targets in this list omit it. The --enable-threads=yes is not specific to PowerPC for RTEMS. So all RTEMS targets should have it or none. With a recent commit this option is superfluous. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] SPARC: add mcpu=leon3v7 target
Ping. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] SPARC: add mcpu=leon3v7 target
Hello, what is the status for this patch? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: spar-rtems add leon3 multlib to 4.9
Hello Joel, this is the wrong patch. We need also the user mode CAS variants for hypervisor support, e.g. https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00057.html We should also wait for Daniel's latest stuff. On 20/08/14 15:51, Joel Sherrill wrote: I would like to add this patch to the 4.9 branch. It is RTEMS specific and takes advantage of the leon3 multilib support from Eric Botcazou. OK to commit? --joel gcc/ChangeLog 2013-08-29 Sebastian Hubersebastian.hu...@embedded-brains.de * config/sparc/t-rtems: Add leon3 multilibs. --- gcc/config/sparc/t-rtems |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/sparc/t-rtems b/gcc/config/sparc/t-rtems index 63d0217..f1a3d84 100644 --- a/gcc/config/sparc/t-rtems +++ b/gcc/config/sparc/t-rtems @@ -17,6 +17,6 @@ #http://www.gnu.org/licenses/. # -MULTILIB_OPTIONS = msoft-float mcpu=v8 -MULTILIB_DIRNAMES = soft v8 +MULTILIB_OPTIONS = msoft-float mcpu=v8/mcpu=leon3 +MULTILIB_DIRNAMES = soft v8 leon3 MULTILIB_MATCHES = msoft-float=mno-fpu -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH v2] RTEMS: Add multilibs for ARM
This change is necessary to support Cortex-M4 and Cortex-R based chips in RTEMS. This patch should be applied to GCC 4.8, 4.9 and mainline. I do not have write access, so in case this gets approved, please commit it for me. gcc/ChangeLog 2014-07-21 Sebastian Huber sebastian.hu...@embedded-brains.de * config/arm/t-rtems-eabi: Add mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard, mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard, mbig-endian/mthumb/march=armv7-r, and mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard multilibs. --- gcc/config/arm/t-rtems-eabi | 124 +++- 1 file changed, 122 insertions(+), 2 deletions(-) diff --git a/gcc/config/arm/t-rtems-eabi b/gcc/config/arm/t-rtems-eabi index d81fbf7..92c4dcb 100644 --- a/gcc/config/arm/t-rtems-eabi +++ b/gcc/config/arm/t-rtems-eabi @@ -1,47 +1,167 @@ # Custom RTEMS EABI multilibs -MULTILIB_OPTIONS = mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon mfloat-abi=hard -MULTILIB_DIRNAMES = thumb armv6-m armv7-a armv7-r armv7-m neon hard +MULTILIB_OPTIONS = mbig-endian mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon/mfpu=vfpv3-d16/mfpu=fpv4-sp-d16 mfloat-abi=hard +MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 fpv4-sp-d16 hard # Enumeration of multilibs MULTILIB_EXCEPTIONS = +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=fpv4-sp-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=fpv4-sp-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon +# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=fpv4-sp-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfloat-abi=hard +# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=fpv4-sp-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=fpv4-sp-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=fpv4-sp-d16 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon/mfloat-abi=hard
Re: [PATCH] RTEMS: Add Nios 2 support
On 07/18/2014 08:30 AM, Chung-Lin Tang wrote: For the default multilib settings, it looks like you just intended to use -mcustom-fpu-cfg=60-2. I suggest you modify t-rtems to do that instead of enumerating the individual FPU insn options. From the documentation https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/Nios-II-Options.html#Nios-II-Options we have -mcustom-fpu-cfg=60-2 is equivalent to: -mcustom-fmuls=252 -mcustom-fadds=253 -mcustom-fsubs=254 -mcustom-fdivs=255 -fsingle-precision-constant This is NOT what I want. I don't want this -fsingle-precision-constant. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] RTEMS: Add multilibs for ARM
Ping. On 2014-07-02 10:15, Sebastian Huber wrote: This change is necessary to support Cortex-R based chips in RTEMS. This patch should be applied to GCC 4.8, 4.9 and mainline. I do not have write access, so in case this gets approved, please commit it for me. gcc/ChangeLog 2014-07-02 Sebastian Huber sebastian.hu...@embedded-brains.de * config/arm/t-rtems-eabi: Add mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard, mbig-endian/mthumb/march=armv7-r, and mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard multilibs. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] RTEMS: Add Nios 2 support
Ping. On 2014-06-26 13:43, Sebastian Huber wrote: This patch should be applied to GCC 4.9 and mainline. I do not have write access, so in case this gets approved, please commit it for me. gcc/ChangeLog 2014-06-26 Sebastian Huber sebastian.hu...@embedded-brains.de * config.gcc (nios2-*-*): Add RTEMS support. * config/nios2/rtems.h: New file. * config/nios2/t-rtems: Likewise. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH v2] typeof: Remove type qualifiers for atomic types
On 2014-06-30 15:03, Marek Polacek wrote: On Fri, Jun 27, 2014 at 08:49:24AM +0200, Marek Polacek wrote: On Fri, Jun 27, 2014 at 08:36:38AM +0200, Sebastian Huber wrote: Thanks for your patience. It would be nice if this can be applied to GCC 4.9 as well. Can someone please commit this for me, since I don't have write access. I will commit it for you. Now applied to 4.9 as well. Marek Should this __typeof and __auto_type behaviour for atomic types show up in the documentation? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH] RTEMS: Add multilibs for ARM
This change is necessary to support Cortex-R based chips in RTEMS. This patch should be applied to GCC 4.8, 4.9 and mainline. I do not have write access, so in case this gets approved, please commit it for me. gcc/ChangeLog 2014-07-02 Sebastian Huber sebastian.hu...@embedded-brains.de * config/arm/t-rtems-eabi: Add mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard, mbig-endian/mthumb/march=armv7-r, and mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard multilibs. --- gcc/config/arm/t-rtems-eabi | 84 +- 1 files changed, 82 insertions(+), 2 deletions(-) diff --git a/gcc/config/arm/t-rtems-eabi b/gcc/config/arm/t-rtems-eabi index d81fbf7..c896e61 100644 --- a/gcc/config/arm/t-rtems-eabi +++ b/gcc/config/arm/t-rtems-eabi @@ -1,47 +1,127 @@ # Custom RTEMS EABI multilibs -MULTILIB_OPTIONS = mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon mfloat-abi=hard -MULTILIB_DIRNAMES = thumb armv6-m armv7-a armv7-r armv7-m neon hard +MULTILIB_OPTIONS = mbig-endian mthumb march=armv6-m/march=armv7-a/march=armv7-r/march=armv7-m mfpu=neon/mfpu=vfpv3-d16 mfloat-abi=hard +MULTILIB_DIRNAMES = eb thumb armv6-m armv7-a armv7-r armv7-m neon vfpv3-d16 hard # Enumeration of multilibs MULTILIB_EXCEPTIONS = +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv6-m +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-a +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=neon +# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r/mfloat-abi=hard +# MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-r +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/march=armv7-m +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/mthumb/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/mthumb +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv6-m +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-a +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-r +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=neon +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16/mfloat-abi=hard +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m/mfpu=vfpv3-d16 +MULTILIB_EXCEPTIONS += mbig-endian/march=armv7-m
Re: [PATCH v2] typeof: Remove type qualifiers for atomic types
On 2014-06-26 17:51, Joseph S. Myers wrote: On Thu, 26 Jun 2014, Sebastian Huber wrote: gcc/c/ChangeLog 2014-06-26 Sebastian Hubersebastian.hu...@embedded-brains.de * c-parser.c (c_parser_declaration_or_fndef): Discard all type qualifiers in __auto_type for atomic types. (c_parser_typeof_specifier): Discard all type qualifiers in __typeof__ for atomic types. gcc/testsuite/ChangeLog 2014-06-26 Sebastian Hubersebastian.hu...@embedded-brains.de * gcc.dg/typeof-2.c: New testcase. OK. Thanks for your patience. It would be nice if this can be applied to GCC 4.9 as well. Can someone please commit this for me, since I don't have write access. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH v2] typeof: Remove type qualifiers for atomic types
GCC provides its own version of stdatomic.h since GCC 4.9. Here we have: #define atomic_load_explicit(PTR, MO)\ __extension__\ ({\ __auto_type __atomic_load_ptr = (PTR);\ __typeof__ (*__atomic_load_ptr) __atomic_load_tmp;\ __atomic_load (__atomic_load_ptr, __atomic_load_tmp, (MO));\ __atomic_load_tmp;\ }) According to http://en.cppreference.com/w/c/atomic/atomic_load (or in the standard 7.17.7.2 The atomic_load generic functions) we have C atomic_load_explicit( volatile A* obj, memory_order order ); This test case #include stdatomic.h int ld(volatile atomic_int *i) { return atomic_load_explicit(i, memory_order_relaxed); } yields on ARM arm-rtems4.11-gcc -march=armv7-a -O2 test.c -S cat test.s .arch armv7-a .fpu softvfp .eabi_attribute 20, 1 .eabi_attribute 21, 1 .eabi_attribute 23, 3 .eabi_attribute 24, 1 .eabi_attribute 25, 1 .eabi_attribute 26, 1 .eabi_attribute 30, 2 .eabi_attribute 34, 1 .eabi_attribute 18, 4 .file test.c .text .align 2 .global ld .type ld, %function ld: @ args = 0, pretend = 0, frame = 8 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. ldr r3, [r0] sub sp, sp, #8 str r3, [sp, #4] ldr r0, [sp, #4] add sp, sp, #8 @ sp needed bx lr .size ld, .-ld .ident GCC: (GNU) 4.9.1 20140515 (prerelease) To solve this performance issue discard all qualifiers in __typeof__ and __auto_type for atomic types. With this patch we have rm-rtems4.11-gcc -march=armv7-a -O2 test.c -S cat test.s .arch armv7-a .fpu softvfp .eabi_attribute 20, 1 .eabi_attribute 21, 1 .eabi_attribute 23, 3 .eabi_attribute 24, 1 .eabi_attribute 25, 1 .eabi_attribute 26, 1 .eabi_attribute 30, 2 .eabi_attribute 34, 1 .eabi_attribute 18, 4 .file test.c .text .align 2 .global ld .type ld, %function ld: @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. ldr r0, [r0] bx lr .size ld, .-ld .ident GCC: (GNU) 4.9.1 20140625 (prerelease) gcc/c/ChangeLog 2014-06-26 Sebastian Huber sebastian.hu...@embedded-brains.de * c-parser.c (c_parser_declaration_or_fndef): Discard all type qualifiers in __auto_type for atomic types. (c_parser_typeof_specifier): Discard all type qualifiers in __typeof__ for atomic types. gcc/testsuite/ChangeLog 2014-06-26 Sebastian Huber sebastian.hu...@embedded-brains.de * gcc.dg/typeof-2.c: New testcase. --- gcc/c/c-parser.c| 21 ++--- gcc/testsuite/gcc.dg/typeof-2.c | 28 2 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/typeof-2.c diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 99ff546..037da03 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -1707,14 +1707,10 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, initializer); init = convert_lvalue_to_rvalue (init_loc, init, true, true); tree init_type = TREE_TYPE (init.value); - /* As with typeof, remove _Atomic and const -qualifiers from atomic types. */ + /* As with typeof, remove all qualifiers from atomic types. */ if (init_type != error_mark_node TYPE_ATOMIC (init_type)) init_type - = c_build_qualified_type (init_type, - (TYPE_QUALS (init_type) - ~(TYPE_QUAL_ATOMIC -| TYPE_QUAL_CONST))); + = c_build_qualified_type (init_type, TYPE_UNQUALIFIED); bool vm_type = variably_modified_type_p (init_type, NULL_TREE); if (vm_type) @@ -3011,16 +3007,11 @@ c_parser_typeof_specifier (c_parser *parser) if (was_vm) ret.expr = c_fully_fold (expr.value, false, ret.expr_const_operands); pop_maybe_used (was_vm); - /* For use in macros such as those in stdatomic.h, remove -_Atomic and const qualifiers from atomic types. (Possibly -all qualifiers should be removed; const can be an issue for -more macros using typeof than just the stdatomic.h -ones
[PATCH] RTEMS: Add Nios 2 support
This patch should be applied to GCC 4.9 and mainline. I do not have write access, so in case this gets approved, please commit it for me. gcc/ChangeLog 2014-06-26 Sebastian Huber sebastian.hu...@embedded-brains.de * config.gcc (nios2-*-*): Add RTEMS support. * config/nios2/rtems.h: New file. * config/nios2/t-rtems: Likewise. --- gcc/config.gcc |4 ++ gcc/config/nios2/rtems.h | 30 ++ gcc/config/nios2/t-rtems | 133 ++ 3 files changed, 167 insertions(+), 0 deletions(-) create mode 100644 gcc/config/nios2/rtems.h create mode 100644 gcc/config/nios2/t-rtems diff --git a/gcc/config.gcc b/gcc/config.gcc index 63e1222..6174375 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -2156,6 +2156,10 @@ nios2-*-*) tm_file=${tm_file} newlib-stdint.h nios2/elf.h extra_options=${extra_options} nios2/elf.opt ;; + nios2-*-rtems*) + tm_file=${tm_file} rtems.h nios2/rtems.h newlib-stdint.h + tmake_file=${tmake_file} nios2/t-rtems + ;; esac ;; pdp11-*-*) diff --git a/gcc/config/nios2/rtems.h b/gcc/config/nios2/rtems.h new file mode 100644 index 000..1028048 --- /dev/null +++ b/gcc/config/nios2/rtems.h @@ -0,0 +1,30 @@ +/* Definitions of RTEMS target support for Altera Nios II. + Copyright (C) 2014 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + http://www.gnu.org/licenses/. */ + +#define TARGET_LINUX_ABI 0 + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ +{ \ + builtin_define (__rtems__);\ + builtin_define (__USE_INIT_FINI__);\ + builtin_assert (system=rtems); \ +} \ + while (false) diff --git a/gcc/config/nios2/t-rtems b/gcc/config/nios2/t-rtems new file mode 100644 index 000..f95fa3c --- /dev/null +++ b/gcc/config/nios2/t-rtems @@ -0,0 +1,133 @@ +# Custom RTEMS multilibs + +MULTILIB_OPTIONS = mhw-mul mhw-mulx mhw-div mcustom-fadds=253 mcustom-fdivs=255 mcustom-fmuls=252 mcustom-fsubs=254 + +# Enumeration of multilibs + +# MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fdivs=255 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fmuls=252 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253/mcustom-fsubs=254 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fadds=253 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fmuls=252 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255/mcustom-fsubs=254 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fdivs=255 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fmuls=252/mcustom-fsubs=254 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fmuls=252 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div/mcustom-fsubs=254 +# MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mhw-div +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252/mcustom-fsubs=254 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fmuls=252 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255/mcustom-fsubs=254 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fdivs=255 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252/mcustom-fsubs=254 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fmuls=252 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253/mcustom-fsubs=254 +MULTILIB_EXCEPTIONS += mhw-mul/mhw-mulx/mcustom-fadds=253 +MULTILIB_EXCEPTIONS += mhw-mul
[PATCH] typeof: Remove type qualifiers for atomic types
GCC provides its own version of stdatomic.h since GCC 4.9. Here we have: #define atomic_load_explicit(PTR, MO)\ __extension__\ ({\ __auto_type __atomic_load_ptr = (PTR);\ __typeof__ (*__atomic_load_ptr) __atomic_load_tmp;\ __atomic_load (__atomic_load_ptr, __atomic_load_tmp, (MO));\ __atomic_load_tmp;\ }) According to http://en.cppreference.com/w/c/atomic/atomic_load (or in the standard 7.17.7.2 The atomic_load generic functions) we have C atomic_load_explicit( volatile A* obj, memory_order order ); This test case #include stdatomic.h int ld(volatile atomic_int *i) { return atomic_load_explicit(i, memory_order_relaxed); } yields on ARM arm-rtems4.11-gcc -march=armv7-a -O2 test.c -S cat test.s .arch armv7-a .fpu softvfp .eabi_attribute 20, 1 .eabi_attribute 21, 1 .eabi_attribute 23, 3 .eabi_attribute 24, 1 .eabi_attribute 25, 1 .eabi_attribute 26, 1 .eabi_attribute 30, 2 .eabi_attribute 34, 1 .eabi_attribute 18, 4 .file test.c .text .align 2 .global ld .type ld, %function ld: @ args = 0, pretend = 0, frame = 8 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. ldr r3, [r0] sub sp, sp, #8 str r3, [sp, #4] ldr r0, [sp, #4] add sp, sp, #8 @ sp needed bx lr .size ld, .-ld .ident GCC: (GNU) 4.9.1 20140515 (prerelease) To solve this performance issue discard all qualifiers in __typeof__ and __auto_type for atomic types. With this patch we have rm-rtems4.11-gcc -march=armv7-a -O2 test.c -S cat test.s .arch armv7-a .fpu softvfp .eabi_attribute 20, 1 .eabi_attribute 21, 1 .eabi_attribute 23, 3 .eabi_attribute 24, 1 .eabi_attribute 25, 1 .eabi_attribute 26, 1 .eabi_attribute 30, 2 .eabi_attribute 34, 1 .eabi_attribute 18, 4 .file test.c .text .align 2 .global ld .type ld, %function ld: @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. ldr r0, [r0] bx lr .size ld, .-ld .ident GCC: (GNU) 4.9.1 20140625 (prerelease) gcc/c/ChangeLog 2014-06-25 Sebastian Huber sebastian.hu...@embedded-brains.de * c-parser.c (c_parser_declaration_or_fndef): Discard all type qualifiers in __auto_type for atomic types. (c_parser_typeof_specifier): Discard all type qualifiers in __typeof__ for atomic types. --- gcc/c/c-parser.c | 21 ++--- 1 files changed, 6 insertions(+), 15 deletions(-) diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 99ff546..037da03 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -1707,14 +1707,10 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, initializer); init = convert_lvalue_to_rvalue (init_loc, init, true, true); tree init_type = TREE_TYPE (init.value); - /* As with typeof, remove _Atomic and const -qualifiers from atomic types. */ + /* As with typeof, remove all qualifiers from atomic types. */ if (init_type != error_mark_node TYPE_ATOMIC (init_type)) init_type - = c_build_qualified_type (init_type, - (TYPE_QUALS (init_type) - ~(TYPE_QUAL_ATOMIC -| TYPE_QUAL_CONST))); + = c_build_qualified_type (init_type, TYPE_UNQUALIFIED); bool vm_type = variably_modified_type_p (init_type, NULL_TREE); if (vm_type) @@ -3011,16 +3007,11 @@ c_parser_typeof_specifier (c_parser *parser) if (was_vm) ret.expr = c_fully_fold (expr.value, false, ret.expr_const_operands); pop_maybe_used (was_vm); - /* For use in macros such as those in stdatomic.h, remove -_Atomic and const qualifiers from atomic types. (Possibly -all qualifiers should be removed; const can be an issue for -more macros using typeof than just the stdatomic.h -ones.) */ + /* For use in macros such as those in stdatomic.h, remove all +qualifiers from atomic types. (const can be an issue for more macros +using typeof than just the stdatomic.h ones.) */ if (ret.spec != error_mark_node TYPE_ATOMIC (ret.spec
Re: [PATCH] typeof: Remove type qualifiers for atomic types
On 06/25/2014 05:56 PM, Joseph S. Myers wrote: On Wed, 25 Jun 2014, Sebastian Huber wrote: 2014-06-25 Sebastian Huber sebastian.hu...@embedded-brains.de * c-parser.c (c_parser_declaration_or_fndef): Discard all type qualifiers in __auto_type for atomic types. (c_parser_typeof_specifier): Discard all type qualifiers in __typeof__ for atomic types. This patch should include a testcase that typeof is discarding volatile (you can e.g. declare an extern variable twice, once as int and once as typeof (*p) where p is volatile _Atomic int *, so the type compatibility check fails unless volatile is discarded). Would be something like this all right for the check? #define CHECK_CORRESPONDING(TYPE1, TYPE2) \ do { TYPE1 a; TYPE2 *b = a; TYPE2 c; TYPE1 *d = c; } while (0) void f(void) { const int *ci; volatile int *vi; CHECK_CORRESPONDING(int *, __typeof__(ci)); CHECK_CORRESPONDING(int *, __typeof__(vi)); } It generates warnings: test.c: In function ‘f’: test.c:8:2: warning: initialization from incompatible pointer type [enabled by default] test.c:8:2: warning: initialization from incompatible pointer type [enabled by default] test.c:9:2: warning: initialization from incompatible pointer type [enabled by default] test.c:9:2: warning: initialization from incompatible pointer type [enabled by default] It is similar to: gcc/testsuite/gcc.dg/c99-stdint-3.c I think its not possible to write a test for the restrict, since it cannot be part of a type? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] testsuite: Register loaded libs
On 2014-04-28 18:24, Mike Stump wrote: On Apr 28, 2014, at 12:32 AM, Sebastian Hubersebastian.hu...@embedded-brains.de wrote: On 2014-04-28 04:23, Mike Stump wrote: On Apr 27, 2014, at 10:45 AM, Sebastian Hubersebastian.hu...@embedded-brains.de wrote: 2014-04-27 Sebastian Hubersebastian.hu...@embedded-brains.de * testsuite/lib/libffi.exp (load_gcc_lib): Register loaded libs. So, I didn’t see anything that strikes me as wrong, but, I’m curious why you want this? I didn’t see any uses? I would like to add tests for C/C++ compatibility of atomic operations. http://gcc.gnu.org/ml/gcc/2014-04/msg00267.html This patch unifies all copy and paste versions of load_gcc_lib. Ah, thanks for the pointer… Ok. Can someone please commit this for me. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH] RTEMS: Adjust SPARC multilibs
A recent fix for the LEON3 support added a new option -muser-mode to select the ASI of the CASA instruction used for atomic operations. Use the user-mode CASA instruction since this works also in supervisor-mode. This patch should be applied to GCC 4.8, 4,9 and mainline. I do not have write access, so in case this gets approved, please commit it for me. gcc/ChangeLog 2014-05-02 Sebastian Huber sebastian.hu...@embedded-brains.de * config/sparc/t-rtems: Use user-mode for leon3 multilibs. --- gcc/config/sparc/t-rtems | 18 -- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gcc/config/sparc/t-rtems b/gcc/config/sparc/t-rtems index f1a3d84..91de612 100644 --- a/gcc/config/sparc/t-rtems +++ b/gcc/config/sparc/t-rtems @@ -17,6 +17,20 @@ # http://www.gnu.org/licenses/. # -MULTILIB_OPTIONS = msoft-float mcpu=v8/mcpu=leon3 -MULTILIB_DIRNAMES = soft v8 leon3 +MULTILIB_OPTIONS = msoft-float mcpu=v8/mcpu=leon3 muser-mode +MULTILIB_DIRNAMES = soft v8 leon3 user-mode MULTILIB_MATCHES = msoft-float=mno-fpu + +# Enumeration of multilibs + +MULTILIB_EXCEPTIONS += msoft-float/mcpu=v8/muser-mode +# MULTILIB_EXCEPTIONS += msoft-float/mcpu=v8 +# MULTILIB_EXCEPTIONS += msoft-float/mcpu=leon3/muser-mode +MULTILIB_EXCEPTIONS += msoft-float/mcpu=leon3 +MULTILIB_EXCEPTIONS += msoft-float/muser-mode +# MULTILIB_EXCEPTIONS += msoft-float +MULTILIB_EXCEPTIONS += mcpu=v8/muser-mode +# MULTILIB_EXCEPTIONS += mcpu=v8 +# MULTILIB_EXCEPTIONS += mcpu=leon3/muser-mode +MULTILIB_EXCEPTIONS += mcpu=leon3 +MULTILIB_EXCEPTIONS += muser-mode -- 1.7.7
Re: [PATCH] RTEMS thread model configuration
Ping. On 2014-04-18 12:11, Sebastian Huber wrote: From: Sebastian Huber sebastian-hu...@web.de The command line to build a GCC for RTEMS contained virtually always a '--enable-threads'. This patch helps to avoid this extra configuration command line parameter and makes the GCC build a bit more user friendly for RTEMS. This patch should be applied to GCC 4.9 branch and master. 2014-04-18 Sebastian Huber sebastian.hu...@embedded-brains.de * config.gcc (*-*-rtems*): Default to 'rtems' thread model. Enable selection of 'posix' or no thread model. --- gcc/config.gcc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 3c55c88..93d5994 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -791,7 +791,13 @@ case ${target} in ;; *-*-rtems*) case ${enable_threads} in -yes) thread_file='rtems' ;; + | yes | rtems) thread_file='rtems' ;; +posix) thread_file='posix' ;; +no) ;; +*) + echo 'Unknown thread configuration for RTEMS' + exit 1 + ;; esac tmake_file=${tmake_file} t-rtems extra_options=${extra_options} rtems.opt -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH] testsuite: Register loaded libs
On 2014-04-28 04:23, Mike Stump wrote: On Apr 27, 2014, at 10:45 AM, Sebastian Huber sebastian.hu...@embedded-brains.de wrote: 2014-04-27 Sebastian Huber sebastian.hu...@embedded-brains.de * testsuite/lib/libffi.exp (load_gcc_lib): Register loaded libs. So, I didn’t see anything that strikes me as wrong, but, I’m curious why you want this? I didn’t see any uses? I would like to add tests for C/C++ compatibility of atomic operations. http://gcc.gnu.org/ml/gcc/2014-04/msg00267.html This patch unifies all copy and paste versions of load_gcc_lib. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH] testsuite: Register loaded libs
libffi/ChangeLog 2014-04-27 Sebastian Huber sebastian.hu...@embedded-brains.de * testsuite/lib/libffi.exp (load_gcc_lib): Register loaded libs. libjava/ChangeLog 2014-04-27 Sebastian Huber sebastian.hu...@embedded-brains.de * testsuite/lib/libjava.exp (load_gcc_lib): Register loaded libs. libstdc++-v3/ChangeLog 2014-04-27 Sebastian Huber sebastian.hu...@embedded-brains.de * testsuite/lib/libstdc++.exp (load_gcc_lib): Register loaded libs. --- libffi/testsuite/lib/libffi.exp | 4 +++- libjava/testsuite/lib/libjava.exp| 4 +++- libstdc++-v3/testsuite/lib/libstdc++.exp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libffi/testsuite/lib/libffi.exp b/libffi/testsuite/lib/libffi.exp index 3c61baa..25efce2 100644 --- a/libffi/testsuite/lib/libffi.exp +++ b/libffi/testsuite/lib/libffi.exp @@ -15,8 +15,10 @@ # http://www.gnu.org/licenses/. proc load_gcc_lib { filename } { -global srcdir +global srcdir loaded_libs + load_file $srcdir/../../gcc/testsuite/lib/$filename +set loaded_libs($filename) } load_lib dg.exp diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp index 0de823b..0cfb253 100644 --- a/libjava/testsuite/lib/libjava.exp +++ b/libjava/testsuite/lib/libjava.exp @@ -2,8 +2,10 @@ # Free Software Foundation proc load_gcc_lib { filename } { -global srcdir +global srcdir loaded_libs + load_file $srcdir/../../gcc/testsuite/lib/$filename +set loaded_libs($filename) } load_lib libgloss.exp diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index 95954d8..a23ea3b 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -38,8 +38,10 @@ # ~/.dejagnurc or $DEJAGNU. proc load_gcc_lib { filename } { -global srcdir +global srcdir loaded_libs + load_file $srcdir/../../gcc/testsuite/lib/$filename +set loaded_libs($filename) } # system routines -- 1.8.1.4
[PATCH] RTEMS thread model configuration
From: Sebastian Huber sebastian-hu...@web.de The command line to build a GCC for RTEMS contained virtually always a '--enable-threads'. This patch helps to avoid this extra configuration command line parameter and makes the GCC build a bit more user friendly for RTEMS. This patch should be applied to GCC 4.9 branch and master. 2014-04-18 Sebastian Huber sebastian.hu...@embedded-brains.de * config.gcc (*-*-rtems*): Default to 'rtems' thread model. Enable selection of 'posix' or no thread model. --- gcc/config.gcc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 3c55c88..93d5994 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -791,7 +791,13 @@ case ${target} in ;; *-*-rtems*) case ${enable_threads} in -yes) thread_file='rtems' ;; + | yes | rtems) thread_file='rtems' ;; +posix) thread_file='posix' ;; +no) ;; +*) + echo 'Unknown thread configuration for RTEMS' + exit 1 + ;; esac tmake_file=${tmake_file} t-rtems extra_options=${extra_options} rtems.opt -- 1.8.1.4
Re: [PATCH v2] SPARC: Clarify -mapp-regs option
Ping. On 2014-03-16 12:43, Sebastian Huber wrote: gcc/ChangeLog 2014-03-16 Sebastian Huber sebastian.hu...@embedded-brains.de * doc/invoke.texi (mapp-regs): Clarify. --- gcc/doc/invoke.texi | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 24bd76e..485867d 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -20817,7 +20817,10 @@ These @samp{-m} options are supported on the SPARC: @opindex mapp-regs Specify @option{-mapp-regs} to generate output using the global registers 2 through 4, which the SPARC SVR4 ABI reserves for applications. This -is the default. +is the default. Like the global register 1 each global register 2 through 4 is +then treated as an allocable register that is clobbered by function calls. +They may be allocated for temporaries or variables that do not live across a +call. To be fully SVR4 ABI-compliant at the cost of some performance loss, specify @option{-mno-app-regs}. You should compile libraries and system -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Re: [PATCH v2] SPARC: Clarify -mapp-regs option
On 2014-03-31 11:59, Richard Biener wrote: On Sun, Mar 16, 2014 at 12:43 PM, Sebastian Huber sebastian.hu...@embedded-brains.de wrote: gcc/ChangeLog 2014-03-16 Sebastian Hubersebastian.hu...@embedded-brains.de * doc/invoke.texi (mapp-regs): Clarify. Ok. Thanks, Richard. I don't have commit access, so can someone please do this for me. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
[PATCH v2] SPARC: Clarify -mapp-regs option
gcc/ChangeLog 2014-03-16 Sebastian Huber sebastian.hu...@embedded-brains.de * doc/invoke.texi (mapp-regs): Clarify. --- gcc/doc/invoke.texi | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 24bd76e..485867d 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -20817,7 +20817,10 @@ These @samp{-m} options are supported on the SPARC: @opindex mapp-regs Specify @option{-mapp-regs} to generate output using the global registers 2 through 4, which the SPARC SVR4 ABI reserves for applications. This -is the default. +is the default. Like the global register 1 each global register 2 through 4 is +then treated as an allocable register that is clobbered by function calls. +They may be allocated for temporaries or variables that do not live across a +call. To be fully SVR4 ABI-compliant at the cost of some performance loss, specify @option{-mno-app-regs}. You should compile libraries and system -- 1.8.1.4