public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-8788] X86: Provide a CTOR for stringop_algs [PR100246].
@ 2021-07-20  6:58 Iain D Sandoe
  0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2021-07-20  6:58 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5dd3fe90a5c0067e3e21d81aa904d13a4154eb4a

commit r11-8788-g5dd3fe90a5c0067e3e21d81aa904d13a4154eb4a
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sat Jul 3 19:47:48 2021 +0100

    X86: Provide a CTOR for stringop_algs [PR100246].
    
    Several older compilers fail to build modern GCC because of missing
    or incomplete C++11 support.
    
    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.
    
    (cherry picked from commit f99f6eb58e1f894dae024f63cc2fe30fa7605e59)

Diff:
---
 gcc/config/i386/i386.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 05e34c8d14a..5583ec6881a 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -251,6 +251,15 @@ struct stringop_algs
 {
   const enum stringop_alg unknown_size;
   const struct stringop_strategy {
+    /* Several older compilers delete the default constructor because of the
+       const entries (see PR100246).  Manually specifying a CTOR works around
+       this issue.  Since this header is used by code compiled with the C
+       compiler we must guard the addition.  */
+#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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-20  6:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20  6:58 [gcc r11-8788] X86: Provide a CTOR for stringop_algs [PR100246] Iain D Sandoe

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