public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pushed] aarch64: Define out-of-class static constants
@ 2024-03-06 10:06 Richard Sandiford
  2024-03-18 13:28 ` Vaseeharan Vinayagamoorthy
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Sandiford @ 2024-03-06 10:06 UTC (permalink / raw)
  To: gcc-patches

While reworking the aarch64 feature descriptions, I forgot
to add out-of-class definitions of some static constants.
This could lead to a build failure with some compilers.

This was seen with some WIP to increase the number of extensions
beyond 64.  It's latent on trunk though, and a regression from
before the rework.

Tested on aarch64-linux-gnu & pushed.

Richard


gcc/
	* config/aarch64/aarch64-feature-deps.h (feature_deps::info): Add
	out-of-class definitions of static constants.
---
 gcc/config/aarch64/aarch64-feature-deps.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/config/aarch64/aarch64-feature-deps.h b/gcc/config/aarch64/aarch64-feature-deps.h
index a1b81f9070b..3641badb82f 100644
--- a/gcc/config/aarch64/aarch64-feature-deps.h
+++ b/gcc/config/aarch64/aarch64-feature-deps.h
@@ -71,6 +71,9 @@ template<aarch64_feature> struct info;
     static constexpr auto enable = flag | get_enable REQUIRES;		\
     static constexpr auto explicit_on = enable | get_enable EXPLICIT_ON; \
   };									\
+  const aarch64_feature_flags info<aarch64_feature::IDENT>::flag;	\
+  const aarch64_feature_flags info<aarch64_feature::IDENT>::enable;	\
+  const aarch64_feature_flags info<aarch64_feature::IDENT>::explicit_on; \
   constexpr info<aarch64_feature::IDENT> IDENT ()			\
   {									\
     return info<aarch64_feature::IDENT> ();				\
-- 
2.25.1


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

* Re: [pushed] aarch64: Define out-of-class static constants
  2024-03-06 10:06 [pushed] aarch64: Define out-of-class static constants Richard Sandiford
@ 2024-03-18 13:28 ` Vaseeharan Vinayagamoorthy
  2024-03-26 17:32   ` Richard Sandiford
  0 siblings, 1 reply; 3+ messages in thread
From: Vaseeharan Vinayagamoorthy @ 2024-03-18 13:28 UTC (permalink / raw)
  To: Richard Sandiford, gcc-patches

Hi Richard,

I think this patch is breaking the build of aarch64-none-elf and aarch64-none-linux-gnu targets, when building with GCC 4.8.
This is not an issue when building with GCC 7.5.

Kind regards,
Vasee

________________________________________
From: Richard Sandiford <richard.sandiford@arm.com>
Sent: 06 March 2024 10:06
To: gcc-patches@gcc.gnu.org
Subject: [pushed] aarch64: Define out-of-class static constants

While reworking the aarch64 feature descriptions, I forgot
to add out-of-class definitions of some static constants.
This could lead to a build failure with some compilers.

This was seen with some WIP to increase the number of extensions
beyond 64.  It's latent on trunk though, and a regression from
before the rework.

Tested on aarch64-linux-gnu & pushed.

Richard


gcc/
        * config/aarch64/aarch64-feature-deps.h (feature_deps::info): Add
        out-of-class definitions of static constants.
---
 gcc/config/aarch64/aarch64-feature-deps.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/config/aarch64/aarch64-feature-deps.h b/gcc/config/aarch64/aarch64-feature-deps.h
index a1b81f9070b..3641badb82f 100644
--- a/gcc/config/aarch64/aarch64-feature-deps.h
+++ b/gcc/config/aarch64/aarch64-feature-deps.h
@@ -71,6 +71,9 @@ template<aarch64_feature> struct info;
     static constexpr auto enable = flag | get_enable REQUIRES;         \
     static constexpr auto explicit_on = enable | get_enable EXPLICIT_ON; \
   };                                                                   \
+  const aarch64_feature_flags info<aarch64_feature::IDENT>::flag;      \
+  const aarch64_feature_flags info<aarch64_feature::IDENT>::enable;    \
+  const aarch64_feature_flags info<aarch64_feature::IDENT>::explicit_on; \
   constexpr info<aarch64_feature::IDENT> IDENT ()                      \
   {                                                                    \
     return info<aarch64_feature::IDENT> ();                            \
--
2.25.1


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

* Re: [pushed] aarch64: Define out-of-class static constants
  2024-03-18 13:28 ` Vaseeharan Vinayagamoorthy
@ 2024-03-26 17:32   ` Richard Sandiford
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Sandiford @ 2024-03-26 17:32 UTC (permalink / raw)
  To: Vaseeharan Vinayagamoorthy; +Cc: gcc-patches

Vaseeharan Vinayagamoorthy <Vaseeharan.Vinayagamoorthy@arm.com> writes:
> Hi Richard,
>
> I think this patch is breaking the build of aarch64-none-elf and aarch64-none-linux-gnu targets, when building with GCC 4.8.
> This is not an issue when building with GCC 7.5.
>
> Kind regards,
> Vasee

Thanks.  I pushed the attached patch to fix it.

Richard

---

GCC 4.8 complained about the use of const rather than constexpr
for out-of-line static constexprs.

gcc/
	* config/aarch64/aarch64-feature-deps.h: Use constexpr for
	out-of-line statics.
---
 gcc/config/aarch64/aarch64-feature-deps.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-feature-deps.h b/gcc/config/aarch64/aarch64-feature-deps.h
index 3641badb82f..79126db8825 100644
--- a/gcc/config/aarch64/aarch64-feature-deps.h
+++ b/gcc/config/aarch64/aarch64-feature-deps.h
@@ -71,9 +71,9 @@ template<aarch64_feature> struct info;
     static constexpr auto enable = flag | get_enable REQUIRES;		\
     static constexpr auto explicit_on = enable | get_enable EXPLICIT_ON; \
   };									\
-  const aarch64_feature_flags info<aarch64_feature::IDENT>::flag;	\
-  const aarch64_feature_flags info<aarch64_feature::IDENT>::enable;	\
-  const aarch64_feature_flags info<aarch64_feature::IDENT>::explicit_on; \
+  constexpr aarch64_feature_flags info<aarch64_feature::IDENT>::flag;	\
+  constexpr aarch64_feature_flags info<aarch64_feature::IDENT>::enable;	\
+  constexpr aarch64_feature_flags info<aarch64_feature::IDENT>::explicit_on; \
   constexpr info<aarch64_feature::IDENT> IDENT ()			\
   {									\
     return info<aarch64_feature::IDENT> ();				\
-- 
2.25.1


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

end of thread, other threads:[~2024-03-26 17:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-06 10:06 [pushed] aarch64: Define out-of-class static constants Richard Sandiford
2024-03-18 13:28 ` Vaseeharan Vinayagamoorthy
2024-03-26 17:32   ` Richard Sandiford

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