public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/111649] New: [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e
@ 2023-09-30 19:21 patrick at rivosinc dot com
  2023-09-30 19:33 ` [Bug target/111649] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: patrick at rivosinc dot com @ 2023-09-30 19:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111649
           Summary: [14 Regression] Bootstrap failure in stage 1 on
                    riscv*-*-* since r14-4348-g9d249b7e31e
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick at rivosinc dot com
  Target Milestone: ---

Caused by r14-4348-g9d249b7e31e

Observed on glibc, newlib
rv{32|64}{gc|gcv|gcv_zvbb_zvbc_zvkg_zvkn_zvknc_zvkned_zvkng_zvknha_zvknhb_zvks_zvksc_zvksed_zvksg_zvksh_zvkt}

Likely not riscv-specific.

Failure:

In file included from ../../../gcc/gcc/hash-table.h:248,
                 from ../../../gcc/gcc/coretypes.h:491,
                 from ../../../gcc/gcc/config/riscv/riscv-vsetvl.cc:82:
../../../gcc/gcc/vec.h: In instantiation of ‘void vec<T, A,
vl_embed>::quick_grow(unsigned int) [with T = riscv_vector::vector_insn_info; A
= va_heap]’:
../../../gcc/gcc/vec.h:2125:23:   required from ‘void
vec<T>::safe_grow(unsigned int, bool) [with T =
riscv_vector::vector_insn_info]’
../../../gcc/gcc/config/riscv/riscv-vsetvl.cc:2420:31:   required from here
../../../gcc/gcc/vec.h:1419:63: error: static assertion failed
 1419 |   static_assert (std::is_trivially_default_constructible <T>::value,
"");
      |                                                               ^~~~~
../../../gcc/gcc/vec.h:1419:63: note: ‘std::integral_constant<bool,
false>::value’ evaluates to false
../../../gcc/gcc/vec.h: In instantiation of ‘void vec<T, A,
vl_embed>::quick_grow(unsigned int) [with T = riscv_vector::vector_block_info;
A = va_heap]’:
../../../gcc/gcc/vec.h:2125:23:   required from ‘void
vec<T>::safe_grow(unsigned int, bool) [with T =
riscv_vector::vector_block_info]’
../../../gcc/gcc/config/riscv/riscv-vsetvl.cc:2421:32:   required from here
../../../gcc/gcc/vec.h:1419:63: error: static assertion failed
../../../gcc/gcc/vec.h:1419:63: note: ‘std::integral_constant<bool,
false>::value’ evaluates to false
g++  -fno-PIE -c   -g -O2   -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute
-Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H
-fno-PIE -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/.
-I../../../gcc/gcc/../include  -I../../../gcc/gcc/../libcpp/include
-I../../../gcc/gcc/../libcody  -I../../../gcc/gcc/../libdecnumber
-I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber
-I../../../gcc/gcc/../libbacktrace   -o sbitmap.o -MT sbitmap.o -MMD -MP -MF
./.deps/sbitmap.TPo ../../../gcc/gcc/sbitmap.cc
make[2]: *** [../../../gcc/gcc/config/riscv/t-riscv:69: riscv-vsetvl.o] Error 1

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

* [Bug target/111649] [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e
  2023-09-30 19:21 [Bug target/111649] New: [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e patrick at rivosinc dot com
@ 2023-09-30 19:33 ` pinskia at gcc dot gnu.org
  2023-09-30 19:33 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-30 19:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
What is the host compiler?

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

* [Bug target/111649] [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e
  2023-09-30 19:21 [Bug target/111649] New: [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e patrick at rivosinc dot com
  2023-09-30 19:33 ` [Bug target/111649] " pinskia at gcc dot gnu.org
@ 2023-09-30 19:33 ` jakub at gcc dot gnu.org
  2023-09-30 19:39 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-30 19:33 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
             Target|riscv                       |
   Target Milestone|---                         |14.0

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This is riscv specific.
As the diagnostics explains, riscv_vector::vector_insn_info has non-trivial
default
constructor, so either it should be used only in {quick,safe}_grow_cleared and
not
{quick,safe}_grow vec operation, or should be changed not to have non-trivial
default constructor, because *_grow doesn't invoke the constructors, only
*_grow_cleared does.
--- gcc/config/riscv/riscv-vsetvl.cc.jj 2023-09-28 11:32:15.966436424 +0200
+++ gcc/config/riscv/riscv-vsetvl.cc    2023-09-30 21:30:05.880134900 +0200
@@ -2417,7 +2417,7 @@ vector_infos_manager::vector_infos_manag
   vector_antin = nullptr;
   vector_antout = nullptr;
   vector_earliest = nullptr;
-  vector_insn_infos.safe_grow (get_max_uid ());
+  vector_insn_infos.safe_grow_cleared (get_max_uid ());
   vector_block_infos.safe_grow (last_basic_block_for_fn (cfun));
   if (!optimize)
     {

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

* [Bug target/111649] [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e
  2023-09-30 19:21 [Bug target/111649] New: [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e patrick at rivosinc dot com
  2023-09-30 19:33 ` [Bug target/111649] " pinskia at gcc dot gnu.org
  2023-09-30 19:33 ` jakub at gcc dot gnu.org
@ 2023-09-30 19:39 ` pinskia at gcc dot gnu.org
  2023-09-30 19:40 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-30 19:39 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-09-30
     Ever confirmed|0                           |1

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

* [Bug target/111649] [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e
  2023-09-30 19:21 [Bug target/111649] New: [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e patrick at rivosinc dot com
                   ` (2 preceding siblings ...)
  2023-09-30 19:39 ` pinskia at gcc dot gnu.org
@ 2023-09-30 19:40 ` pinskia at gcc dot gnu.org
  2023-09-30 19:42 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-30 19:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #2)
> This is riscv specific.
> As the diagnostics explains, riscv_vector::vector_insn_info has non-trivial
> default
> constructor, so either it should be used only in {quick,safe}_grow_cleared
> and not
> {quick,safe}_grow vec operation, or should be changed not to have non-trivial
> default constructor, because *_grow doesn't invoke the constructors, only
> *_grow_cleared does.
> --- gcc/config/riscv/riscv-vsetvl.cc.jj	2023-09-28 11:32:15.966436424 +0200
> +++ gcc/config/riscv/riscv-vsetvl.cc	2023-09-30 21:30:05.880134900 +0200
> @@ -2417,7 +2417,7 @@ vector_infos_manager::vector_infos_manag
>    vector_antin = nullptr;
>    vector_antout = nullptr;
>    vector_earliest = nullptr;
> -  vector_insn_infos.safe_grow (get_max_uid ());
> +  vector_insn_infos.safe_grow_cleared (get_max_uid ());
>    vector_block_infos.safe_grow (last_basic_block_for_fn (cfun));
>    if (!optimize)
>      {

This patch fixes the build for me; have not tested it otherwise.

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

* [Bug target/111649] [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e
  2023-09-30 19:21 [Bug target/111649] New: [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e patrick at rivosinc dot com
                   ` (3 preceding siblings ...)
  2023-09-30 19:40 ` pinskia at gcc dot gnu.org
@ 2023-09-30 19:42 ` pinskia at gcc dot gnu.org
  2023-09-30 19:47 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-30 19:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> This patch fixes the build for me; have not tested it otherwise.

Actually both need to be _cleared:
  vector_insn_infos.safe_grow_cleared (get_max_uid ());
  vector_block_infos.safe_grow_cleared (last_basic_block_for_fn (cfun));

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

* [Bug target/111649] [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e
  2023-09-30 19:21 [Bug target/111649] New: [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e patrick at rivosinc dot com
                   ` (4 preceding siblings ...)
  2023-09-30 19:42 ` pinskia at gcc dot gnu.org
@ 2023-09-30 19:47 ` jakub at gcc dot gnu.org
  2023-09-30 20:13 ` patrick at rivosinc dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-30 19:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> This patch fixes the build for me; have not tested it otherwise.

It will make stuff slower but more correct.
I think it is up to the riscv maintainers to decide what they want.

(In reply to Andrew Pinski from comment #5)
>   vector_block_infos.safe_grow_cleared (last_basic_block_for_fn (cfun));

Indeed.  While vector_block_info has defaulted default constructor, as its
members are vector_insn_info which have non-trivial default constructors, it
has non-trivial one as well.

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

* [Bug target/111649] [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e
  2023-09-30 19:21 [Bug target/111649] New: [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e patrick at rivosinc dot com
                   ` (5 preceding siblings ...)
  2023-09-30 19:47 ` jakub at gcc dot gnu.org
@ 2023-09-30 20:13 ` patrick at rivosinc dot com
  2023-09-30 23:09 ` cvs-commit at gcc dot gnu.org
  2023-10-02 16:12 ` patrick at rivosinc dot com
  8 siblings, 0 replies; 10+ messages in thread
From: patrick at rivosinc dot com @ 2023-09-30 20:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Patrick O'Neill <patrick at rivosinc dot com> ---
Thanks for the quick fix. Confirmed that changing both safe_grow ->
safe_grow_cleared resolves the bootstrap failure on rv64gc glibc.

Would it be possible to commit this fix as a stopgap (or rollback the assert)
until the riscv target maintainers decide what they want to do?

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

* [Bug target/111649] [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e
  2023-09-30 19:21 [Bug target/111649] New: [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e patrick at rivosinc dot com
                   ` (6 preceding siblings ...)
  2023-09-30 20:13 ` patrick at rivosinc dot com
@ 2023-09-30 23:09 ` cvs-commit at gcc dot gnu.org
  2023-10-02 16:12 ` patrick at rivosinc dot com
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-30 23:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick O'Neill <poneill@gcc.gnu.org>:

https://gcc.gnu.org/g:04e772bbdcbc1cea67cd498c1a45e4360bf5f8e1

commit r14-4351-g04e772bbdcbc1cea67cd498c1a45e4360bf5f8e1
Author: Patrick O'Neill <patrick@rivosinc.com>
Date:   Sat Sep 30 15:50:11 2023 -0700

    RISC-V: Use safe_grow_cleared for vector info [PR111649]

    Resolves a riscv*-*-* bootstrap failure due to a newly-turned-on assert.

    2023-09-30  Jakub Jelinek  <jakub@redhat.com>

    gcc/ChangeLog:

            PR target/111649

            * config/riscv/riscv-vsetvl.cc
(vector_infos_manager::vector_infos_manager):
            Replace safe_grow with safe_grow_cleared.

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

* [Bug target/111649] [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e
  2023-09-30 19:21 [Bug target/111649] New: [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e patrick at rivosinc dot com
                   ` (7 preceding siblings ...)
  2023-09-30 23:09 ` cvs-commit at gcc dot gnu.org
@ 2023-10-02 16:12 ` patrick at rivosinc dot com
  8 siblings, 0 replies; 10+ messages in thread
From: patrick at rivosinc dot com @ 2023-10-02 16:12 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick O'Neill <patrick at rivosinc dot com> changed:

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

--- Comment #9 from Patrick O'Neill <patrick at rivosinc dot com> ---
Builds no longer fail due to this issue.

There is some follow-up discussion on the mailing list about improving the
performance of the affected code using lazily allocation & dynamic
initialization:
https://inbox.sourceware.org/gcc-patches/da3d1e8c-3df2-2008-ad14-a3036b6f6665@rivosinc.com/T/#m65e9d134dfea988ad77b099cef83f194079078c4

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

end of thread, other threads:[~2023-10-02 16:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-30 19:21 [Bug target/111649] New: [14 Regression] Bootstrap failure in stage 1 on riscv*-*-* since r14-4348-g9d249b7e31e patrick at rivosinc dot com
2023-09-30 19:33 ` [Bug target/111649] " pinskia at gcc dot gnu.org
2023-09-30 19:33 ` jakub at gcc dot gnu.org
2023-09-30 19:39 ` pinskia at gcc dot gnu.org
2023-09-30 19:40 ` pinskia at gcc dot gnu.org
2023-09-30 19:42 ` pinskia at gcc dot gnu.org
2023-09-30 19:47 ` jakub at gcc dot gnu.org
2023-09-30 20:13 ` patrick at rivosinc dot com
2023-09-30 23:09 ` cvs-commit at gcc dot gnu.org
2023-10-02 16:12 ` patrick at rivosinc dot com

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