public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96901] New: [11 Regression] Many libstdc++ tests FAIL on i686-linux due to a PCH FE bug
@ 2020-09-02 16:51 jakub at gcc dot gnu.org
  2020-09-02 16:52 ` [Bug c++/96901] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-09-02 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96901
           Summary: [11 Regression] Many libstdc++ tests FAIL on
                    i686-linux due to a PCH FE bug
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

I'm seeing following regressions between Monday and Tuesday evening CET trunk
bootstraps:
 Running target unix
+FAIL: 20_util/bind/42593.cc (test for excess errors)
+FAIL: 20_util/bind/48698.cc (test for excess errors)
+FAIL: 20_util/is_compound/value.cc (test for excess errors)
+FAIL: 20_util/is_fundamental/value.cc (test for excess errors)
+FAIL: 20_util/is_signed/value.cc (test for excess errors)
+FAIL: 20_util/is_unsigned/value.cc (test for excess errors)
+FAIL: 20_util/unique_ptr/assign/nullptr.cc (test for excess errors)
+UNRESOLVED: 20_util/unique_ptr/assign/nullptr.cc compilation failed to produce
executable
+FAIL: 20_util/unique_ptr/cons/convertible_neg.cc (test for excess errors)
+FAIL: 20_util/unique_ptr/cons/incomplete.cc (test for excess errors)
+FAIL: 20_util/unique_ptr/cons/nullptr.cc (test for excess errors)
+UNRESOLVED: 20_util/unique_ptr/cons/nullptr.cc compilation failed to produce
executable
+FAIL:
20_util/unique_ptr/requirements/explicit_instantiation/explicit_instantiation.cc
(test for excess errors)
+FAIL: 21_strings/basic_string/allocator/wchar_t/noexcept.cc (test for excess
errors)
+FAIL: 22_locale/conversions/string/requirements/typedefs-2.cc (test for excess
errors)
+FAIL: 23_containers/list/allocator/noexcept.cc (test for excess errors)
+FAIL: 23_containers/map/modifiers/insert/2.cc (test for excess errors)
+UNRESOLVED: 23_containers/map/modifiers/insert/2.cc compilation failed to
produce executable
+FAIL: 23_containers/map/modifiers/insert/5.cc (test for excess errors)
+UNRESOLVED: 23_containers/map/modifiers/insert/5.cc compilation failed to
produce executable
+FAIL: 23_containers/multimap/modifiers/insert/2.cc (test for excess errors)
+UNRESOLVED: 23_containers/multimap/modifiers/insert/2.cc compilation failed to
produce executable
+FAIL: 23_containers/multimap/modifiers/insert/22102.cc (test for excess
errors)
+UNRESOLVED: 23_containers/multimap/modifiers/insert/22102.cc compilation
failed to produce executable
+FAIL: 23_containers/multimap/modifiers/insert/4.cc (test for excess errors)
+UNRESOLVED: 23_containers/multimap/modifiers/insert/4.cc compilation failed to
produce executable
+FAIL: 23_containers/multiset/allocator/swap.cc (test for excess errors)
+UNRESOLVED: 23_containers/multiset/allocator/swap.cc compilation failed to
produce executable
+FAIL: 23_containers/set/allocator/swap.cc (test for excess errors)
+UNRESOLVED: 23_containers/set/allocator/swap.cc compilation failed to produce
executable
+FAIL: 23_containers/unordered_map/insert/map_single_move-2.cc (test for excess
errors)
+UNRESOLVED: 23_containers/unordered_map/insert/map_single_move-2.cc
compilation failed to produce executable
+FAIL: 23_containers/unordered_map/modifiers/reserve.cc (test for excess
errors)
+UNRESOLVED: 23_containers/unordered_map/modifiers/reserve.cc compilation
failed to produce executable
+FAIL: 23_containers/vector/allocator/noexcept.cc (test for excess errors)
+FAIL: 23_containers/vector/bool/allocator/noexcept.cc (test for excess errors)
+FAIL: 25_algorithms/max/constexpr.cc (test for excess errors)
+FAIL: 25_algorithms/min/constexpr.cc (test for excess errors)
+FAIL: 26_numerics/random/cauchy_distribution/cons/default.cc (test for excess
errors)
+UNRESOLVED: 26_numerics/random/cauchy_distribution/cons/default.cc compilation
failed to produce executable
+FAIL: 26_numerics/random/extreme_value_distribution/cons/default.cc (test for
excess errors)
+UNRESOLVED: 26_numerics/random/extreme_value_distribution/cons/default.cc
compilation failed to produce executable
+FAIL: 26_numerics/random/normal_distribution/cons/default.cc (test for excess
errors)
+UNRESOLVED: 26_numerics/random/normal_distribution/cons/default.cc compilation
failed to produce executable
+FAIL: 26_numerics/random/student_t_distribution/cons/default.cc (test for
excess errors)
+UNRESOLVED: 26_numerics/random/student_t_distribution/cons/default.cc
compilation failed to produce executable
+FAIL: 28_regex/match_results/ctors/wchar_t/default.cc (test for excess errors)
+UNRESOLVED: 28_regex/match_results/ctors/wchar_t/default.cc compilation failed
to produce executable
 FAIL: 29_atomics/atomic_float/1.cc execution test
+FAIL: 30_threads/thread/adl.cc (test for excess errors)
+FAIL: experimental/net/buffer/traits.cc (test for excess errors)
+FAIL: experimental/net/execution_context/make_service.cc (test for excess
errors)
 FAIL: experimental/net/internet/resolver/ops/lookup.cc execution test
+FAIL: experimental/optional/relops/2.cc (test for excess errors)
+UNRESOLVED: experimental/optional/relops/2.cc compilation failed to produce
executable
+FAIL: experimental/optional/relops/3.cc (test for excess errors)
+UNRESOLVED: experimental/optional/relops/3.cc compilation failed to produce
executable
+FAIL: ext/random/normal_mv_distribution/cons/default.cc (test for excess
errors)
+UNRESOLVED: ext/random/normal_mv_distribution/cons/default.cc compilation
failed to produce executable

                === libstdc++ Summary ===

-# of expected passes           15192
-# of unexpected failures       2
+# of expected passes           15136
+# of unexpected failures       40
 # of expected failures         98
+# of unresolved testcases      19
 # of unsupported tests         334

-Compiler version: 11.0.0 20200831 (experimental) (GCC) 
+Compiler version: 11.0.0 20200901 (experimental) (GCC) 
 Platform: i686-pc-linux-gnu

The regressions ICEs are all PCH related, with ICEs like:
FAIL: 20_util/bind/42593.cc (test for excess errors)
Excess errors:
/home/jakub/src/gcc/obj71/i686-pc-linux-gnu/libstdc++-v3/include/chrono:441:  
in 'constexpr' expansion of 'std::chrono::duration<long long int, std::ratio<1,
1000000000> >::_S_gcd(((intmax_t)std::ratio<1>::den), ((intmax_t)std::ratio<1,
1000000000>::den))'
/home/jakub/src/gcc/obj71/i686-pc-linux-gnu/libstdc++-v3/include/chrono:442:
internal compiler error: Segmentation fault
0x8dd035a crash_signal
        ../../gcc/toplev.c:327
0x86877b6 cxx_eval_call_expression
        ../../gcc/cp/constexpr.c:2622
0x8688782 cxx_eval_constant_expression
        ../../gcc/cp/constexpr.c:5765
0x868bcab cxx_eval_outermost_constant_expr
        ../../gcc/cp/constexpr.c:6772
0x86901c0 maybe_constant_value(tree_node*, tree_node*, bool)
        ../../gcc/cp/constexpr.c:7045
0x87195dc fold_for_warn(tree_node*)
        ../../gcc/cp/expr.c:418

It is PCH related and very hard to reproduce, after all, the same cc1plus
doesn't crash always, but only sometimes.
I've tracked it to what seems to be another occurrence of PR92458, this time on
fundef_copies_table.  This is a non-deletable non-cache hash_map<tree, tree>
preserved across PCH, which means it is hashed when compiling the PCH header
using pointer hashing of the decls, then PCH reassigns addresses to GC
registered objects.  When PCH is read, the hash_map will usually contain keys
with different hash values compared to what it hashed originally, so there are
chances that some fundef->decl isn't found.  The ICE is because we don't find
an entry for _S_gcd, so add a for now NULL value to that function, but the
addition  to the hash table results in later call not finding that NULL entry,
but some other one from before PCH was saved, which results in very bad things
for recursive constexpr calls.

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

* [Bug c++/96901] [11 Regression] Many libstdc++ tests FAIL on i686-linux due to a PCH FE bug
  2020-09-02 16:51 [Bug c++/96901] New: [11 Regression] Many libstdc++ tests FAIL on i686-linux due to a PCH FE bug jakub at gcc dot gnu.org
@ 2020-09-02 16:52 ` jakub at gcc dot gnu.org
  2020-09-02 16:57 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-09-02 16:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Target Milestone|---                         |11.0
           Priority|P3                          |P1
   Last reconfirmed|                            |2020-09-02
     Ever confirmed|0                           |1

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

* [Bug c++/96901] [11 Regression] Many libstdc++ tests FAIL on i686-linux due to a PCH FE bug
  2020-09-02 16:51 [Bug c++/96901] New: [11 Regression] Many libstdc++ tests FAIL on i686-linux due to a PCH FE bug jakub at gcc dot gnu.org
  2020-09-02 16:52 ` [Bug c++/96901] " jakub at gcc dot gnu.org
@ 2020-09-02 16:57 ` jakub at gcc dot gnu.org
  2020-09-03 19:54 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-09-02 16:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 49176
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49176&action=edit
gcc11-pr96901.patch

Untested fix.

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

* [Bug c++/96901] [11 Regression] Many libstdc++ tests FAIL on i686-linux due to a PCH FE bug
  2020-09-02 16:51 [Bug c++/96901] New: [11 Regression] Many libstdc++ tests FAIL on i686-linux due to a PCH FE bug jakub at gcc dot gnu.org
  2020-09-02 16:52 ` [Bug c++/96901] " jakub at gcc dot gnu.org
  2020-09-02 16:57 ` jakub at gcc dot gnu.org
@ 2020-09-03 19:54 ` cvs-commit at gcc dot gnu.org
  2020-09-11  7:47 ` cvs-commit at gcc dot gnu.org
  2020-10-16 12:07 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-03 19:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

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

commit r11-3001-gba6730bd18371a3dff1e37d2c2ee27233285b597
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Sep 3 21:53:40 2020 +0200

    c++: Fix another PCH hash_map issue [PR96901]

    The recent libstdc++ changes caused lots of libstdc++-v3 tests FAILs
    on i686-linux, all of them in the same spot during constexpr evaluation
    of a recursive _S_gcd call.
    The problem is yet another hash_map that used the default hasing of
    tree keys through pointer hashing which is preserved across PCH write/read.
    During PCH handling, the addresses of GC objects are changed, which means
    that the hash values of the keys in such hash tables change without those
    hash tables being rehashed.  Which in the fundef_copies_table case usually
    means we just don't find a copy of a FUNCTION_DECL body for recursive uses
    and start from scratch.  But when the hash table keeps growing, the "dead"
    elements in the hash table can sometimes reappear and break things.
    In particular what I saw under the debugger is when the fundef_copies_table
    hash map has been used on the outer _S_gcd call, it didn't find an entry
for
    it, so returned a slot with *slot == NULL, which is treated as that the
    function itself is used directly (i.e. no recursion), but that addition of
    a hash table slot caused the recursive _S_gcd call to actually find
    something in the hash table, unfortunately not the new *slot == NULL spot,
    but a different one from the pre-PCH streaming which contained the returned
    toplevel (non-recursive) call entry for it, which means that for the
    recursive _S_gcd call we actually used the same trees as for the outer ones
    rather than a copy of those, which breaks constexpr evaluation.

    2020-09-03  Jakub Jelinek  <jakub@redhat.com>

            PR c++/96901
            * tree.h (struct decl_tree_traits): New type.
            (decl_tree_map): New typedef.

            * constexpr.c (fundef_copies_table): Change type from
            hash_map<tree, tree> * to decl_tree_map *.

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

* [Bug c++/96901] [11 Regression] Many libstdc++ tests FAIL on i686-linux due to a PCH FE bug
  2020-09-02 16:51 [Bug c++/96901] New: [11 Regression] Many libstdc++ tests FAIL on i686-linux due to a PCH FE bug jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-09-03 19:54 ` cvs-commit at gcc dot gnu.org
@ 2020-09-11  7:47 ` cvs-commit at gcc dot gnu.org
  2020-10-16 12:07 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-11  7:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:3dfe983656318c1aaa33c7f9a5a341c5904aa5b6

commit r10-8732-g3dfe983656318c1aaa33c7f9a5a341c5904aa5b6
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Sep 3 21:53:40 2020 +0200

    c++: Fix another PCH hash_map issue [PR96901]

    The recent libstdc++ changes caused lots of libstdc++-v3 tests FAILs
    on i686-linux, all of them in the same spot during constexpr evaluation
    of a recursive _S_gcd call.
    The problem is yet another hash_map that used the default hasing of
    tree keys through pointer hashing which is preserved across PCH write/read.
    During PCH handling, the addresses of GC objects are changed, which means
    that the hash values of the keys in such hash tables change without those
    hash tables being rehashed.  Which in the fundef_copies_table case usually
    means we just don't find a copy of a FUNCTION_DECL body for recursive uses
    and start from scratch.  But when the hash table keeps growing, the "dead"
    elements in the hash table can sometimes reappear and break things.
    In particular what I saw under the debugger is when the fundef_copies_table
    hash map has been used on the outer _S_gcd call, it didn't find an entry
for
    it, so returned a slot with *slot == NULL, which is treated as that the
    function itself is used directly (i.e. no recursion), but that addition of
    a hash table slot caused the recursive _S_gcd call to actually find
    something in the hash table, unfortunately not the new *slot == NULL spot,
    but a different one from the pre-PCH streaming which contained the returned
    toplevel (non-recursive) call entry for it, which means that for the
    recursive _S_gcd call we actually used the same trees as for the outer ones
    rather than a copy of those, which breaks constexpr evaluation.

    2020-09-03  Jakub Jelinek  <jakub@redhat.com>

            PR c++/96901
            * tree.h (struct decl_tree_traits): New type.
            (decl_tree_map): New typedef.

            * constexpr.c (fundef_copies_table): Change type from
            hash_map<tree, tree> * to decl_tree_map *.

    (cherry picked from commit ba6730bd18371a3dff1e37d2c2ee27233285b597)

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

* [Bug c++/96901] [11 Regression] Many libstdc++ tests FAIL on i686-linux due to a PCH FE bug
  2020-09-02 16:51 [Bug c++/96901] New: [11 Regression] Many libstdc++ tests FAIL on i686-linux due to a PCH FE bug jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-09-11  7:47 ` cvs-commit at gcc dot gnu.org
@ 2020-10-16 12:07 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-16 12:07 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02 16:51 [Bug c++/96901] New: [11 Regression] Many libstdc++ tests FAIL on i686-linux due to a PCH FE bug jakub at gcc dot gnu.org
2020-09-02 16:52 ` [Bug c++/96901] " jakub at gcc dot gnu.org
2020-09-02 16:57 ` jakub at gcc dot gnu.org
2020-09-03 19:54 ` cvs-commit at gcc dot gnu.org
2020-09-11  7:47 ` cvs-commit at gcc dot gnu.org
2020-10-16 12:07 ` rguenth 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).