public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Support g++ 4.8 as a host compiler.
@ 2023-10-04 22:19 Roger Sayle
  2023-10-05  5:52 ` Xi Ruoyao
  2023-10-07 16:19 ` Jeff Law
  0 siblings, 2 replies; 13+ messages in thread
From: Roger Sayle @ 2023-10-04 22:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: 'Richard Sandiford'

[-- Attachment #1: Type: text/plain, Size: 799 bytes --]


The recent patch to remove poly_int_pod triggers a bug in g++ 4.8.5's
C++ 11 support which mistakenly believes poly_uint16 has a non-trivial
constructor.  This in turn prohibits it from being used as a member in
a union (rtxunion) that constructed statically, resulting in a (fatal)
error during stage 1.  A workaround is to add an explicit constructor
to the problematic union, which allows mainline to be bootstrapped with
the system compiler on older RedHat 7 systems.

This patch has been tested on x86_64-pc-linux-gnu where it allows a
bootstrap to complete when using g++ 4.8.5 as the host compiler.
Ok for mainline?


2023-10-04  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	* rtl.h (rtx_def::u): Add explicit constructor to workaround
	issue using g++ 4.8 as a host compiler.


[-- Attachment #2: patchbs.txt --]
[-- Type: text/plain, Size: 390 bytes --]

diff --git a/gcc/rtl.h b/gcc/rtl.h
index 6850281..a7667f5 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -451,6 +451,9 @@ struct GTY((desc("0"), tag("0"),
     struct fixed_value fv;
     struct hwivec_def hwiv;
     struct const_poly_int_def cpi;
+#if defined(__GNUC__) && GCC_VERSION < 5000
+    u () {}
+#endif
   } GTY ((special ("rtx_def"), desc ("GET_CODE (&%0)"))) u;
 };
 

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

end of thread, other threads:[~2023-10-18 11:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-04 22:19 [PATCH] Support g++ 4.8 as a host compiler Roger Sayle
2023-10-05  5:52 ` Xi Ruoyao
2023-10-07 16:19 ` Jeff Law
2023-10-07 21:30   ` Sam James
2023-10-08  4:40     ` Jeff Law
2023-10-08  8:08       ` Iain Sandoe
2023-10-15 10:50   ` Roger Sayle
2023-10-15 11:43     ` Richard Sandiford
2023-10-18  8:37       ` Eric Gallager
2023-10-18 10:17       ` Jakub Jelinek
2023-10-18 10:23         ` Richard Sandiford
2023-10-18 11:33           ` Jakub Jelinek
2023-10-18 11:51             ` Jakub Jelinek

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