public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] X86: Provide a CTOR for stringop_algs [PR100246].
@ 2021-07-04 20:03 Iain Sandoe
  2021-07-05 10:50 ` Richard Biener
  0 siblings, 1 reply; 10+ messages in thread
From: Iain Sandoe @ 2021-07-04 20:03 UTC (permalink / raw)
  To: GCC Patches

Hi,

Several older compilers fail to build modern GCC because of missing
or incomplete C++11 support.

(although the PR mentions clang, specifically, this has also been reported
 for some GCC versions within the range that should be able to bootstrap
 GCC)

There are several possible solutions proposed in the PR, this one seems
 the least invasive.

The header is pulled into the gcov code that builds with C, so we have to
make the CTOR conditional on C++.

tested on Darwin12 with xcode-6, bootstrapped on x86_64-darwin and linux.
OK for master / GCC-11?
thanks
Iain

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

PR bootstrap/100246 - [11/12 Regression] GCC will not bootstrap with clang 3.4/3.5 [xcode 5/6, Darwin 12/13]

	PR bootstrap/100246

gcc/ChangeLog:

	* config/i386/i386.h (struct stringop_algs): Define a CTOR for
	this type.
---
 gcc/config/i386/i386.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 6e0340a4b60..84151156999 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -73,6 +73,11 @@ struct stringop_algs
 {
   const enum stringop_alg unknown_size;
   const struct stringop_strategy {
+#ifdef __cplusplus
+    stringop_strategy(int _max = -1, enum stringop_alg _alg = libcall,
+		      int _noalign = false)
+      : max (_max), alg (_alg), noalign (_noalign) {}
+#endif
     const int max;
     const enum stringop_alg alg;
     int noalign;
-- 
2.24.1



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

end of thread, other threads:[~2021-11-05 10:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-04 20:03 [PATCH] X86: Provide a CTOR for stringop_algs [PR100246] Iain Sandoe
2021-07-05 10:50 ` Richard Biener
2021-07-05 13:04   ` Iain Sandoe
2021-07-05 13:23     ` Richard Biener
2021-07-06 10:17       ` Iain Sandoe
2021-11-04 10:05         ` [PATCH] x86: Make stringop_algs::stringop_strategy ctor constexpr [PR100246] Jakub Jelinek
2021-11-04 12:39           ` Iain Sandoe
2021-11-04 12:45             ` Jakub Jelinek
2021-11-05  9:58               ` Jakub Jelinek
2021-11-05 10:33                 ` Richard Biener

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).