diff mbox series

sparcv9: Disable -Wuninitialized warnings breaking bootstrap [PR92002]

Message ID yddeegwgwhs.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show
Series sparcv9: Disable -Wuninitialized warnings breaking bootstrap [PR92002] | expand

Commit Message

Rainer Orth March 3, 2021, 2:09 p.m. UTC
sparcv9 bootstrap has been broken for 1 1/2 years now by spurious
-Wuninitialized warnings:

In function ‘wide_int wi::max_value(unsigned int, signop)’,
    inlined from ‘wide_int wi::max_value(unsigned int, signop)’ at /vol/gcc/src/hg/master/local/gcc/wide-int.cc:330:1:
/vol/gcc/src/hg/master/local/gcc/wide-int.cc:335:31: error: ‘<anonymous>.generic_wide_int<wide_int_storage>::<anonymous>.wide_int_storage::val[1]’ may be used uninitialized [-Werror=maybe-uninitialized]
  335 |     return shwi (-1, precision);
      |                               ^
[...]
In function ‘wide_int get_nonzero_bits(const_tree)’,
    inlined from ‘wide_int get_nonzero_bits(const_tree)’ at /vol/gcc/src/hg/master/local/gcc/tree-ssanames.c:531:1:
/vol/gcc/src/hg/master/local/gcc/tree-ssanames.c:544:67: error: ‘<anonymous>.generic_wide_int<wide_int_storage>::<anonymous>.wide_int_storage::val[1]’ may be used uninitialized [-Werror=maybe-uninitialized]
  544 |                          | (HOST_WIDE_INT) pi->misalign, precision);
      |                                                                   ^
[...]

Before we ship yet another release with this issue, I suggest to at
least include a workaround of demoting them to warnings.

Tested on sparcv9-sun-solaris2.11.

Ok for master?

I originally meant to propose the patch for the gcc-10 branch as well,
but when I tried a sparcv9-sun-solaris2.11 bootstrap there some time
ago, it wasn't affected any longer.

	Rainer

Comments

Eric Botcazou March 3, 2021, 2:43 p.m. UTC | #1
> sparcv9 bootstrap has been broken for 1 1/2 years now by spurious
> -Wuninitialized warnings:

IIRC we used to have 3 of them, now we have 2 so there is some progress. ;-)

> Before we ship yet another release with this issue, I suggest to at
> least include a workaround of demoting them to warnings.
> 
> Tested on sparcv9-sun-solaris2.11.
> 
> Ok for master?

Sure.

> I originally meant to propose the patch for the gcc-10 branch as well,
> but when I tried a sparcv9-sun-solaris2.11 bootstrap there some time
> ago, it wasn't affected any longer.

But release branches do not have -Werror set, do they?
Rainer Orth March 3, 2021, 3:13 p.m. UTC | #2
Hi Eric,

>> sparcv9 bootstrap has been broken for 1 1/2 years now by spurious
>> -Wuninitialized warnings:
>
> IIRC we used to have 3 of them, now we have 2 so there is some progress. ;-)
>
>> Before we ship yet another release with this issue, I suggest to at
>> least include a workaround of demoting them to warnings.
>> 
>> Tested on sparcv9-sun-solaris2.11.
>> 
>> Ok for master?
>
> Sure.

Thanks, installed.

>> I originally meant to propose the patch for the gcc-10 branch as well,
>> but when I tried a sparcv9-sun-solaris2.11 bootstrap there some time
>> ago, it wasn't affected any longer.
>
> But release branches do not have -Werror set, do they?

Right, I forgot.  That's what you get for mostly ignoring older branches
except for a weekly bootstrap or two ;-)

	Rainer
diff mbox series

Patch

# HG changeset patch
# Parent  710ee5be5a4d126389146bc2e4ab9bbcc36a44e1
Hack around 64-bit SPARC bootstrap failure (PR bootstrap/92002)

diff --git a/gcc/config/sparc/t-sparc b/gcc/config/sparc/t-sparc
--- a/gcc/config/sparc/t-sparc
+++ b/gcc/config/sparc/t-sparc
@@ -27,3 +27,7 @@  sparc-c.o: $(srcdir)/config/sparc/sparc-
 sparc-d.o: $(srcdir)/config/sparc/sparc-d.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)
+
+# Hack around PR bootstrap/92002.
+tree-ssanames.o-warn += -Wno-error=uninitialized -Wno-error=maybe-uninitialized
+wide-int.o-warn += -Wno-error=uninitialized -Wno-error=maybe-uninitialized