[gcc r15-1720] jit: Fix Darwin bootstrap after r15-1699.
Iain D Sandoe
iains@gcc.gnu.org
Sat Jun 29 02:50:17 GMT 2024
https://gcc.gnu.org/g:45e74d5dfa4c5f372df0d3545bc342b6a2505e71
commit r15-1720-g45e74d5dfa4c5f372df0d3545bc342b6a2505e71
Author: Iain Sandoe <iain@sandoe.co.uk>
Date: Sat Jun 29 03:10:59 2024 +0100
jit: Fix Darwin bootstrap after r15-1699.
r15-1699-g445c62ee492 contains changes that trigger two maybe-uninitialized
warnings on Darwin, which result in a bootstrap failure.
Note that the warnings are false positives, in fact the variables should be
initialized in the cases of a switch (all values of the switch condition are
covered).
Fixed here by providing default initializations for the relevant variables.
gcc/jit/ChangeLog:
* jit-recording.cc
(recording::memento_of_typeinfo::make_debug_string): Default the value
of ident.
(recording::memento_of_typeinfo::write_reproducer): Default the value
of type.
Signed-off-by: Iain Sandoe <iains@gcc.gnu.org>
Diff:
---
gcc/jit/jit-recording.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
index f68d01fff55..43a6795f8f3 100644
--- a/gcc/jit/jit-recording.cc
+++ b/gcc/jit/jit-recording.cc
@@ -5516,7 +5516,7 @@ recording::memento_of_typeinfo::replay_into (replayer *r)
recording::string *
recording::memento_of_typeinfo::make_debug_string ()
{
- const char* ident;
+ const char* ident = "";
switch (m_info_type)
{
case TYPE_INFO_ALIGN_OF:
@@ -5538,7 +5538,7 @@ recording::memento_of_typeinfo::make_debug_string ()
void
recording::memento_of_typeinfo::write_reproducer (reproducer &r)
{
- const char* type;
+ const char* type = "";
switch (m_info_type)
{
case TYPE_INFO_ALIGN_OF:
More information about the Gcc-cvs
mailing list