public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/95555] New: [11 regression] bootstrap build failure starting with r11-959
@ 2020-06-05 18:15 seurer at linux dot vnet.ibm.com
  2020-06-05 19:00 ` [Bug bootstrap/95555] " msebor at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: seurer at linux dot vnet.ibm.com @ 2020-06-05 18:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95555

            Bug ID: 95555
           Summary: [11 regression] bootstrap build failure starting with
                    r11-959
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at linux dot vnet.ibm.com
  Target Milestone: ---

g:b825a22890740f341eae566af27e18e528cd29a7, r11-959 

/home/seurer/gcc/git/build/gcc-trunk-bootstrap/./prev-gcc/xg++
-B/home/seurer/gcc/git/build/gcc-trunk-bootstrap/./prev-gcc/
-B/home/seurer/gcc/git/install/gcc-trunk-bootstrap/powerpc64-unknown-linux-gnu/bin/
-nostdinc++
-B/home/seurer/gcc/git/build/gcc-trunk-bootstrap/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/src/.libs
-B/home/seurer/gcc/git/build/gcc-trunk-bootstrap/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs

-I/home/seurer/gcc/git/build/gcc-trunk-bootstrap/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/include/powerpc64-unknown-linux-gnu

-I/home/seurer/gcc/git/build/gcc-trunk-bootstrap/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/include
 -I/home/seurer/gcc/git/gcc-trunk-bootstrap/libstdc++-v3/libsupc++
-L/home/seurer/gcc/git/build/gcc-trunk-bootstrap/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/home/seurer/gcc/git/build/gcc-trunk-bootstrap/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
 -fno-PIE -c   -g -O2 -fno-checking -gtoggle -DIN_GCC     -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -I.
-I/home/seurer/gcc/git/gcc-trunk-bootstrap/gcc
-I/home/seurer/gcc/git/gcc-trunk-bootstrap/gcc/.
-I/home/seurer/gcc/git/gcc-trunk-bootstrap/gcc/../include
-I/home/seurer/gcc/git/gcc-trunk-bootstrap/gcc/../libcpp/include
-I/home/seurer/gcc/git/build/gcc-trunk-bootstrap/./gmp
-I/home/seurer/gcc/git/gcc-trunk-bootstrap/gmp
-I/home/seurer/gcc/git/build/gcc-trunk-bootstrap/./mpfr/src
-I/home/seurer/gcc/git/gcc-trunk-bootstrap/mpfr/src
-I/home/seurer/gcc/git/gcc-trunk-bootstrap/mpc/src 
-I/home/seurer/gcc/git/gcc-trunk-bootstrap/gcc/../libdecnumber
-I/home/seurer/gcc/git/gcc-trunk-bootstrap/gcc/../libdecnumber/dpd
-I../libdecnumber
-I/home/seurer/gcc/git/gcc-trunk-bootstrap/gcc/../libbacktrace
-I/home/seurer/gcc/git/build/gcc-trunk-bootstrap/./isl/include
-I/home/seurer/gcc/git/gcc-trunk-bootstrap/isl/include  -o postreload.o -MT
postreload.o -MMD -MP -MF ./.deps/postreload.TPo
/home/seurer/gcc/git/gcc-trunk-bootstrap/gcc/postreload.c
/home/seurer/gcc/git/gcc-trunk-bootstrap/gcc/postreload.c: In function 'int
reload_cse_simplify_operands(rtx_insn*, rtx)':
/home/seurer/gcc/git/gcc-trunk-bootstrap/gcc/postreload.c:629:5: error:
'*alternative_order' may be used uninitialized [-Werror=maybe-uninitialized]
  629 |   j = alternative_order[0];
      |   ~~^~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[3]: *** [postreload.o] Error 1

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

* [Bug bootstrap/95555] [11 regression] bootstrap build failure starting with r11-959
  2020-06-05 18:15 [Bug bootstrap/95555] New: [11 regression] bootstrap build failure starting with r11-959 seurer at linux dot vnet.ibm.com
@ 2020-06-05 19:00 ` msebor at gcc dot gnu.org
  2020-06-05 19:50 ` schwab@linux-m68k.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-06-05 19:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95555

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
The reload_cse_simplify_operands() function allocates three arrays but resets
only two:

  alternative_reject = XALLOCAVEC (int, recog_data.n_alternatives);
  alternative_nregs = XALLOCAVEC (int, recog_data.n_alternatives);
  alternative_order = XALLOCAVEC (int, recog_data.n_alternatives);
  memset (alternative_reject, 0, recog_data.n_alternatives * sizeof (int));
  memset (alternative_nregs, 0, recog_data.n_alternatives * sizeof (int));

It then assigns to the alternative_order array in the loop below, but only
conditionally:

  /* Record all alternatives which are better or equal to the currently
     matching one in the alternative_order array.  */
  for (i = j = 0; i < recog_data.n_alternatives; i++)
    if (alternative_reject[i] <= alternative_reject[which_alternative])
      alternative_order[j++] = i;
  recog_data.n_alternatives = j;

Finally, it unconditionally reads the first element:

  /* Substitute the operands as determined by op_alt_regno for the best
     alternative.  */
  j = alternative_order[0];

I don't know this part of the compiler to tell if the first element is
guaranteed to be stored into by the loop, and it seems that GCC can't figure it
out either, so it issues the warning.  That's expected.  If the element is
guaranteed to be set by the loop then storing a zero into it before the loop
should be safe and avoid the warning.  If it isn't, someone familiar with the
code should look into what the right initial value should be.  The affected
code hasn't changed since 2003 but Jakub and Richard Sandiford have made
changes to the function since then so they might be able to help.

In the meantime, I would suggest zeroing out the first element to see if that
helps.  Bill, can you give it a try?

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

* [Bug bootstrap/95555] [11 regression] bootstrap build failure starting with r11-959
  2020-06-05 18:15 [Bug bootstrap/95555] New: [11 regression] bootstrap build failure starting with r11-959 seurer at linux dot vnet.ibm.com
  2020-06-05 19:00 ` [Bug bootstrap/95555] " msebor at gcc dot gnu.org
@ 2020-06-05 19:50 ` schwab@linux-m68k.org
  2020-06-05 21:07 ` msebor at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2020-06-05 19:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95555

--- Comment #2 from Andreas Schwab <schwab@linux-m68k.org> ---
alternative_order[0] is guaranteed to be set, because alternative_reject[i] <=
alternative_reject[which_alternative] for i == which_alternative at least.  We
know that which_alternative < recog_data.n_alternatives, otherwise
alternative_reject[which_alternative] would be undefined.

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

* [Bug bootstrap/95555] [11 regression] bootstrap build failure starting with r11-959
  2020-06-05 18:15 [Bug bootstrap/95555] New: [11 regression] bootstrap build failure starting with r11-959 seurer at linux dot vnet.ibm.com
  2020-06-05 19:00 ` [Bug bootstrap/95555] " msebor at gcc dot gnu.org
  2020-06-05 19:50 ` schwab@linux-m68k.org
@ 2020-06-05 21:07 ` msebor at gcc dot gnu.org
  2020-06-05 22:24 ` seurer at linux dot vnet.ibm.com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-06-05 21:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95555

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to Andreas Schwab from comment #2)
> alternative_order[0] is guaranteed to be set, because alternative_reject[i]
> <= alternative_reject[which_alternative] for i == which_alternative at
> least.  We know that which_alternative < recog_data.n_alternatives,
> otherwise alternative_reject[which_alternative] would be undefined.

That's another way of saying that the code must be correct because otherwise it
would be undefined.  (There is no obvious constraint that which_alternative is
less than recog_data.n_alternatives.)

But if clearing alternative_order[0] is safe and if avoids the warning it's
fine with me.  Bill, can you please confirm that the patch below suppresses it
(I can't reproduce it on my end)?

diff --git a/gcc/postreload.c b/gcc/postreload.c
index f6258285022..9b4e2bd9efb 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -592,6 +592,10 @@ reload_cse_simplify_operands (rtx_insn *insn, rtx testreg)
        }
     }

+  /* The loop below sets alternative_order[0] but -Wmaybe-uninitialized
+     can't know that.  Clear it here to avoid the warning.  */
+  alternative_order[0] = 0;
+
   /* Record all alternatives which are better or equal to the currently
      matching one in the alternative_order array.  */
   for (i = j = 0; i < recog_data.n_alternatives; i++)

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

* [Bug bootstrap/95555] [11 regression] bootstrap build failure starting with r11-959
  2020-06-05 18:15 [Bug bootstrap/95555] New: [11 regression] bootstrap build failure starting with r11-959 seurer at linux dot vnet.ibm.com
                   ` (2 preceding siblings ...)
  2020-06-05 21:07 ` msebor at gcc dot gnu.org
@ 2020-06-05 22:24 ` seurer at linux dot vnet.ibm.com
  2020-06-06  7:19 ` schwab@linux-m68k.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: seurer at linux dot vnet.ibm.com @ 2020-06-05 22:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95555

--- Comment #4 from Bill Seurer <seurer at linux dot vnet.ibm.com> ---
bootstrap works with that patch

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

* [Bug bootstrap/95555] [11 regression] bootstrap build failure starting with r11-959
  2020-06-05 18:15 [Bug bootstrap/95555] New: [11 regression] bootstrap build failure starting with r11-959 seurer at linux dot vnet.ibm.com
                   ` (3 preceding siblings ...)
  2020-06-05 22:24 ` seurer at linux dot vnet.ibm.com
@ 2020-06-06  7:19 ` schwab@linux-m68k.org
  2020-06-06 20:31 ` msebor at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2020-06-06  7:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95555

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
               Host|powerpc64*-linux-gnu        |
              Build|powerpc64*-linux-gnu        |
             Target|powerpc64*-linux-gnu        |

--- Comment #5 from Andreas Schwab <schwab@linux-m68k.org> ---
Can we please get bootstrap back?

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

* [Bug bootstrap/95555] [11 regression] bootstrap build failure starting with r11-959
  2020-06-05 18:15 [Bug bootstrap/95555] New: [11 regression] bootstrap build failure starting with r11-959 seurer at linux dot vnet.ibm.com
                   ` (4 preceding siblings ...)
  2020-06-06  7:19 ` schwab@linux-m68k.org
@ 2020-06-06 20:31 ` msebor at gcc dot gnu.org
  2020-06-08 15:07 ` cvs-commit at gcc dot gnu.org
  2020-06-08 15:08 ` msebor at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-06-06 20:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95555

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
               Host|                            |powerpc64*-linux
             Target|                            |powerpc64*-linux
   Last reconfirmed|                            |2020-06-06
              Build|                            |powerpc64*-linux
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot gnu.org
           Keywords|                            |patch
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2020-June/547436.html

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

* [Bug bootstrap/95555] [11 regression] bootstrap build failure starting with r11-959
  2020-06-05 18:15 [Bug bootstrap/95555] New: [11 regression] bootstrap build failure starting with r11-959 seurer at linux dot vnet.ibm.com
                   ` (5 preceding siblings ...)
  2020-06-06 20:31 ` msebor at gcc dot gnu.org
@ 2020-06-08 15:07 ` cvs-commit at gcc dot gnu.org
  2020-06-08 15:08 ` msebor at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-08 15:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95555

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Sebor <msebor@gcc.gnu.org>:

https://gcc.gnu.org/g:c1057cc0a8ad972e0a2218ab74038a56e5514c39

commit r11-1067-gc1057cc0a8ad972e0a2218ab74038a56e5514c39
Author: Martin Sebor <msebor@redhat.com>
Date:   Mon Jun 8 09:06:48 2020 -0600

    PR bootstrap/95555 - powepc64 bootstrap failure due to
-Wmaybe-uninitialized in reload_cse_simplify_operands

    gcc/ChangeLog:

            * postreload.c (reload_cse_simplify_operands): Clear first array
element
            before using it.  Assert a precondition.

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

* [Bug bootstrap/95555] [11 regression] bootstrap build failure starting with r11-959
  2020-06-05 18:15 [Bug bootstrap/95555] New: [11 regression] bootstrap build failure starting with r11-959 seurer at linux dot vnet.ibm.com
                   ` (6 preceding siblings ...)
  2020-06-08 15:07 ` cvs-commit at gcc dot gnu.org
@ 2020-06-08 15:08 ` msebor at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-06-08 15:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95555

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> ---
Fixed by r11-1067.

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

end of thread, other threads:[~2020-06-08 15:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05 18:15 [Bug bootstrap/95555] New: [11 regression] bootstrap build failure starting with r11-959 seurer at linux dot vnet.ibm.com
2020-06-05 19:00 ` [Bug bootstrap/95555] " msebor at gcc dot gnu.org
2020-06-05 19:50 ` schwab@linux-m68k.org
2020-06-05 21:07 ` msebor at gcc dot gnu.org
2020-06-05 22:24 ` seurer at linux dot vnet.ibm.com
2020-06-06  7:19 ` schwab@linux-m68k.org
2020-06-06 20:31 ` msebor at gcc dot gnu.org
2020-06-08 15:07 ` cvs-commit at gcc dot gnu.org
2020-06-08 15:08 ` msebor at gcc dot gnu.org

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