public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
@ 2022-01-14  6:06 rimvydas.jas at gmail dot com
  2022-01-15  8:58 ` [Bug libstdc++/104019] " pinskia at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: rimvydas.jas at gmail dot com @ 2022-01-14  6:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104019
           Summary: Testsuite
                    17_intro/headers/c++2020/stdc++_multiple_inclusion.cc
                    failures
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rimvydas.jas at gmail dot com
  Target Milestone: ---

Testsuite on x86_64-*-dragonfly gives:

Running target unix
FAIL: 17_intro/headers/c++1998/stdc++.cc (test for excess errors)
FAIL: 17_intro/headers/c++1998/stdc++_multiple_inclusion.cc (test for excess
errors)
FAIL: 17_intro/headers/c++2011/stdc++.cc (test for excess errors)
FAIL: 17_intro/headers/c++2011/stdc++_multiple_inclusion.cc (test for excess
errors)
FAIL: 17_intro/headers/c++2014/stdc++.cc (test for excess errors)
FAIL: 17_intro/headers/c++2014/stdc++_multiple_inclusion.cc (test for excess
errors)
FAIL: 17_intro/headers/c++2017/stdc++.cc (test for excess errors)
FAIL: 17_intro/headers/c++2017/stdc++_multiple_inclusion.cc (test for excess
errors)
Excess errors:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr_base.h:340:
warning: dereferencing type-punned pointer will break strict-aliasing rules
[-Wstrict-aliasing]

FAIL: 17_intro/headers/c++2020/stdc++.cc (test for excess errors)
spawn -ignore SIGHUP /build/trunk/./gcc/xg++ -shared-libgcc
-B/build/trunk/./gcc -nostdinc++
-L/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/src
-L/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/src/.libs
-L/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/libsupc++/.libs
-B/opt/gcctrunk/x86_64-unknown-dragonfly6.3/bin/
-B/opt/gcctrunk/x86_64-unknown-dragonfly6.3/lib/ -isystem
/opt/gcctrunk/x86_64-unknown-dragonfly6.3/include -isystem
/opt/gcctrunk/x86_64-unknown-dragonfly6.3/sys-include -fchecking=1
-B/build/trunk/x86_64-unknown-dragonfly6.3/./libstdc++-v3/src/.libs
-fmessage-length=0 -fno-show-column -ffunction-sections -fdata-sections -g -O2
-DLOCALEDIR="." -nostdinc++
-I/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-dragonfly6.3
-I/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include
-I/data/gg/libstdc++-v3/libsupc++ -I/data/gg/libstdc++-v3/include/backward
-I/data/gg/libstdc++-v3/testsuite/util
/data/gg/libstdc++-v3/testsuite/17_intro/headers/c++2020/stdc++_multiple_inclusion.cc
-std=gnu++2a -Wall -Wsystem-headers -fdiagnostics-plain-output -S -o
stdc++_multiple_inclusion.s
In file included from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-dragonfly6.3/bits/stdc++.h:152,
                 from
/data/gg/libstdc++-v3/testsuite/17_intro/headers/c++2020/stdc++_multiple_inclusion.cc:25:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/version:81:
warning: "__cpp_lib_exchange_function" redefined
In file included from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-dragonfly6.3/bits/stdc++.h:94,
                 from
/data/gg/libstdc++-v3/testsuite/17_intro/headers/c++2020/stdc++_multiple_inclusion.cc:25:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/utility:87: note:
this is the location of the previous definition
In file included from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-dragonfly6.3/bits/stdc++.h:152,
                 from
/data/gg/libstdc++-v3/testsuite/17_intro/headers/c++2020/stdc++_multiple_inclusion.cc:25:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/version:83:
warning: "__cpp_lib_integer_sequence" redefined
In file included from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/stl_pair.h:62,
                 from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/stl_algobase.h:64,
                 from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/specfun.h:45,
                 from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/cmath:1935,
                 from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-dragonfly6.3/bits/stdc++.h:41,
                 from
/data/gg/libstdc++-v3/testsuite/17_intro/headers/c++2020/stdc++_multiple_inclusion.cc:25:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/utility.h:160:
note: this is the location of the previous definition
In file included from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-dragonfly6.3/bits/stdc++.h:152,
                 from
/data/gg/libstdc++-v3/testsuite/17_intro/headers/c++2020/stdc++_multiple_inclusion.cc:25:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/version:128:
warning: "__cpp_lib_as_const" redefined
In file included from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-dragonfly6.3/bits/stdc++.h:94,
                 from
/data/gg/libstdc++-v3/testsuite/17_intro/headers/c++2020/stdc++_multiple_inclusion.cc:25:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/utility:100:
note: this is the location of the previous definition
In file included from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr.h:53,
                 from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/memory:77,
                 from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-dragonfly6.3/bits/stdc++.h:82,
                 from
/data/gg/libstdc++-v3/testsuite/17_intro/headers/c++2020/stdc++_multiple_inclusion.cc:25:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr_base.h:
In member function 'void std::_Sp_counted_base<_Lp>::_M_release() [with
__gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]':
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr_base.h:340:
warning: dereferencing type-punned pointer will break strict-aliasing rules
[-Wstrict-aliasing]
In file included from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-dragonfly6.3/bits/stdc++.h:144,
                 from
/data/gg/libstdc++-v3/testsuite/17_intro/headers/c++2020/stdc++_multiple_inclusion.cc:25:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/latch: In member
function 'void std::latch::count_down(std::ptrdiff_t)':
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/latch:65:
warning: comparison of integer expressions of different signedness: 'const long
unsigned int' and 'std::ptrdiff_t' {aka 'long int'} [-Wsign-compare]
FAIL: 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc (test for excess
errors)
Excess errors:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/version:81:
warning: "__cpp_lib_exchange_function" redefined
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/version:83:
warning: "__cpp_lib_integer_sequence" redefined
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/version:128:
warning: "__cpp_lib_as_const" redefined
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr_base.h:340:
warning: dereferencing type-punned pointer will break strict-aliasing rules
[-Wstrict-aliasing]
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/latch:65:
warning: comparison of integer expressions of different signedness: 'const long
unsigned int' and 'std::ptrdiff_t' {aka 'long int'} [-Wsign-compare]

extra_tool_flags are:  -std=gnu++2a -Wall -Wsystem-headers

In comparison the releases/gcc-11 branch currently has only -Wsign-compare
warning in c++2020 testcases.

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
@ 2022-01-15  8:58 ` pinskia at gcc dot gnu.org
  2022-01-15  9:36 ` redi at gcc dot gnu.org
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-15  8:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-01-15
             Target|                            |*-*-freebsd* *-*-dragonfly*

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

Oh there is a difference:
include/bits/utility.h:#define __cpp_lib_integer_sequence 201304L
include/std/version:# define __cpp_lib_integer_sequence 201304

include/std/utility:#define __cpp_lib_exchange_function 201304L
include/std/version:# define __cpp_lib_exchange_function 201304


// FreeBSD wants warning clean system headers:
// { dg-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* }
}


Confirmed.
I suspect there are more regressions lately because we have not had a testsuite
results from dragonfly recently likewise from freebsd too.

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
  2022-01-15  8:58 ` [Bug libstdc++/104019] " pinskia at gcc dot gnu.org
@ 2022-01-15  9:36 ` redi at gcc dot gnu.org
  2022-01-15 12:22 ` redi at gcc dot gnu.org
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-15  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

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

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
  2022-01-15  8:58 ` [Bug libstdc++/104019] " pinskia at gcc dot gnu.org
  2022-01-15  9:36 ` redi at gcc dot gnu.org
@ 2022-01-15 12:22 ` redi at gcc dot gnu.org
  2022-01-15 12:23 ` redi at gcc dot gnu.org
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-15 12:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I have a script that's supposed to pick up those macro inconsistencies, I
wonder why it's not working.

The aliasing violation is real, we should use memset instead.

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (2 preceding siblings ...)
  2022-01-15 12:22 ` redi at gcc dot gnu.org
@ 2022-01-15 12:23 ` redi at gcc dot gnu.org
  2022-01-21 13:55 ` redi at gcc dot gnu.org
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-15 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (3 preceding siblings ...)
  2022-01-15 12:23 ` redi at gcc dot gnu.org
@ 2022-01-21 13:55 ` redi at gcc dot gnu.org
  2022-01-21 16:08 ` cvs-commit at gcc dot gnu.org
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-21 13:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #2)
> The aliasing violation is real, we should use memset instead.

Patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589024.html

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (4 preceding siblings ...)
  2022-01-21 13:55 ` redi at gcc dot gnu.org
@ 2022-01-21 16:08 ` cvs-commit at gcc dot gnu.org
  2022-01-21 16:10 ` redi at gcc dot gnu.org
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-21 16:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

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

commit r12-6798-gb8806796ec64585de39ca6ee3b7b30cc08f27d62
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Jan 21 14:22:23 2022 +0000

    libstdc++: Ensure all feature test macros have type long [PR87193]

    This defines all the __cpp_lib_xxx macros as type long, as required by
    the standard. We had an inconsistent mix of int and long, sometimes even
    for the same macro name.

    The __cpp_lib_experimental_xxx macros are left as type int, because
    that's what it says in the relevant TS specs.

    libstdc++-v3/ChangeLog:

            PR libstdc++/87193
            PR libstdc++/104019
            * include/bits/alloc_traits.h
(__cpp_lib_allocator_traits_is_always_equal):
            Define as type long.
            * include/bits/allocator.h
(__cpp_lib_incomplete_container_elements):
            Likewise.
            * include/bits/basic_string.h (__cpp_lib_string_udls): Likewise.
            * include/bits/chrono.h (__cpp_lib_chrono): Likewise.
            (__cpp_lib_chrono_udls): Likewise.
            * include/bits/move.h (__cpp_lib_addressof_constexpr): Likewise.
            * include/bits/node_handle.h (__cpp_lib_node_extract): Likewise.
            * include/bits/range_access.h
(__cpp_lib_nonmember_container_access):
            Likewise.
            * include/bits/shared_ptr.h (__cpp_lib_enable_shared_from_this):
            Likewise.
            * include/bits/stl_algo.h (__cpp_lib_clamp): Likewise.
            (__cpp_lib_sample): Likewise.
            * include/bits/stl_algobase.h
(__cpp_lib_robust_nonmodifying_seq_ops):
            Likewise.
            * include/bits/stl_function.h (__cpp_lib_transparent_operators):
            Likewise.
            * include/bits/stl_iterator.h (__cpp_lib_make_reverse_iterator):
            Likewise.
            * include/bits/stl_map.h (__cpp_lib_map_try_emplace):
            Likewise.
            * include/bits/stl_tree.h (__cpp_lib_generic_associative_lookup):
            Likewise.
            * include/bits/unique_ptr.h (__cpp_lib_make_unique):
            Likewise.
            * include/bits/unordered_map.h
(__cpp_lib_unordered_map_try_emplace):
            Likewise.
            * include/c_global/cmath (__cpp_lib_hypot): Likewise.
            * include/c_global/cstddef (__cpp_lib_byte): Likewise.
            * include/std/atomic (__cpp_lib_atomic_is_always_lock_free):
            Likewise.
            * include/std/complex (__cpp_lib_complex_udls): Likewise.
            * include/std/filesystem (__cpp_lib_filesystem): Likewise.
            * include/std/functional (__cpp_lib_not_fn): Likewise.
            (__cpp_lib_boyer_moore_searcher): Likewise.
            * include/std/iomanip (__cpp_lib_quoted_string_io): Likewise.
            * include/std/mutex (__cpp_lib_scoped_lock): Likewise.
            * include/std/numeric (__cpp_lib_gcd_lcm): Likewise.
            (__cpp_lib_gcd, __cpp_lib_lcm): Likewise.
            * include/std/tuple (__cpp_lib_apply): Likewise.
            (__cpp_lib_make_from_tuple): Likewise.
            * include/std/type_traits (__cpp_lib_integral_constant_callable)
            (__cpp_lib_bool_constant, __cpp_lib_logical_traits)
            (__cpp_lib_is_null_pointer, __cpp_lib_transformation_trait_aliases)
            (__cpp_lib_result_of_sfinae, __cpp_lib_void_t)
            (__cpp_lib_is_swappable, __cpp_lib_is_invocable)
            (__cpp_lib_has_unique_object_representations)
            (__cpp_lib_is_aggregate): Likewise.
            * include/std/version: Likewise.
            * libsupc++/new (__cpp_lib_launder): Likewise.

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (5 preceding siblings ...)
  2022-01-21 16:08 ` cvs-commit at gcc dot gnu.org
@ 2022-01-21 16:10 ` redi at gcc dot gnu.org
  2022-01-23 22:49 ` cvs-commit at gcc dot gnu.org
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-21 16:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The macros should all be OK now. The aliasing fix isn't pushed yet.

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (6 preceding siblings ...)
  2022-01-21 16:10 ` redi at gcc dot gnu.org
@ 2022-01-23 22:49 ` cvs-commit at gcc dot gnu.org
  2022-01-23 22:54 ` redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-23 22:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:2d8a9ad4a922e3248d0f6c60a6331be6f47dc435

commit r12-6826-g2d8a9ad4a922e3248d0f6c60a6331be6f47dc435
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Jan 21 12:08:20 2022 +0000

    libstdc++: Fix aliasing violation in std::shared_ptr [PR104019]

    The non-atomic store that sets both reference counts to zero uses a
    type-punned pointer, which has undefined behaviour. We could use memset
    to write 8 bytes, but we don't actually need it to be a single store
    anyway. No other thread can observe the values, that's why it's safe to
    use non-atomic stores in the first place. So we can just set each count
    to zero.

    With -fstore-merging (which is enabled by default at -O2) GCC produces
    the same code for this as for memset or the type punned store. Clang
    does that store merging even at -O1.

    libstdc++-v3/ChangeLog:

            PR libstdc++/104019
            * include/bits/shared_ptr_base.h (_Sp_counted_base<>::_M_release):
            Set members to zero without type punning.

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (7 preceding siblings ...)
  2022-01-23 22:49 ` cvs-commit at gcc dot gnu.org
@ 2022-01-23 22:54 ` redi at gcc dot gnu.org
  2022-01-24  5:57 ` rimvydas.jas at gmail dot com
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-23 22:54 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Should be OK now.

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (8 preceding siblings ...)
  2022-01-23 22:54 ` redi at gcc dot gnu.org
@ 2022-01-24  5:57 ` rimvydas.jas at gmail dot com
  2022-01-24  6:02 ` rimvydas.jas at gmail dot com
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rimvydas.jas at gmail dot com @ 2022-01-24  5:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Rimvydas (RJ) <rimvydas.jas at gmail dot com> ---
Thank you for the patches.  Testsuite now gives:

PASS: 17_intro/headers/c++1998/stdc++.cc (test for excess errors)PASS:
17_intro/headers/c++1998/stdc++_multiple_inclusion.cc (test for excess errors)
PASS: 17_intro/headers/c++2011/stdc++.cc (test for excess errors)
PASS: 17_intro/headers/c++2011/stdc++_multiple_inclusion.cc (test for excess
errors)
PASS: 17_intro/headers/c++2014/stdc++.cc (test for excess errors)
PASS: 17_intro/headers/c++2014/stdc++_multiple_inclusion.cc (test for excess
errors)
PASS: 17_intro/headers/c++2017/stdc++.cc (test for excess errors)
PASS: 17_intro/headers/c++2017/stdc++_multiple_inclusion.cc (test for excess
errors)

FAIL: 17_intro/headers/c++2020/stdc++.cc (test for excess errors)
FAIL: 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc (test for excess
errors)
In file included from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr.h:53,
                 from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/memory:77,
                 from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-dragonfly6.3/bits/stdc++.h:82,
                 from
/data/gg/libstdc++-v3/testsuite/17_intro/headers/c++2020/stdc++.cc:25:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr_base.h:
In member function 'void std::_Sp_counted_array_base<_Alloc>::_M_init(typename
std::allocator_traits<_Alloc>::value_type*, _Init)':
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr_base.h:767:
warning: typedef 'using value_type = using _Up = typename
std::allocator_traits<_Alloc>::value_type' locally defined but not used
[-Wunused-local-typedefs]
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr_base.h:768:
warning: typedef 'using difference_type = std::ptrdiff_t' locally defined but
not used [-Wunused-local-typedefs]
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr_base.h:771:
warning: typedef 'using iterator_category = struct std::forward_iterator_tag'
locally defined but not used [-Wunused-local-typedefs]
In file included from
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-dragonfly6.3/bits/stdc++.h:144:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/latch: In member
function 'void std::latch::count_down(std::ptrdiff_t)':
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/latch:65:
warning: comparison of integer expressions of different signedness: 'const long
unsigned int' and 'std::ptrdiff_t' {aka 'long int'} [-Wsign-compare]
FAIL: 17_intro/headers/c++2020/stdc++.cc (test for excess errors)
Excess errors:
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr_base.h:767:
warning: typedef 'using value_type = using _Up = typename
std::allocator_traits<_Alloc>::value_type' locally defined but not used
[-Wunused-local-typedefs]
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr_base.h:768:
warning: typedef 'using difference_type = std::ptrdiff_t' locally defined but
not used [-Wunused-local-typedefs]
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/shared_ptr_base.h:771:
warning: typedef 'using iterator_category = struct std::forward_iterator_tag'
locally defined but not used [-Wunused-local-typedefs]
/build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/latch:65:
warning: comparison of integer expressions of different signedness: 'const long
unsigned int' and 'std::ptrdiff_t' {aka 'long int'} [-Wsign-compare]

The -Wunused-local-typedefs warnings seem to have been recently introduced in
g:9a0b518a82db68c5cbd9ea8ccc47c2ff45182519 commit.
Same c++2020 warnings are reproducible on GLIBC targets when running:
$ make check-target-libstdc++-v3 -k RUNTESTFLAGS="conformance.exp=stdc\+\+*.cc
--target_board=unix/-Wall/-Wsystem-headers/"

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (9 preceding siblings ...)
  2022-01-24  5:57 ` rimvydas.jas at gmail dot com
@ 2022-01-24  6:02 ` rimvydas.jas at gmail dot com
  2022-01-24 12:23 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rimvydas.jas at gmail dot com @ 2022-01-24  6:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Rimvydas (RJ) <rimvydas.jas at gmail dot com> ---
Also there are more possible teststuite failures when running with:
$  make check-target-libstdc++-v3 -k RUNTESTFLAGS="conformance.exp=17_intro*
--target_board=unix/-Wall/-Wsystem-headers/-Wno-c++11-extensions/-Wno-volatile/-Wno-deprecated-declarations/-Wno-pedantic"

FAIL: 17_intro/headers/c++2011/all_no_exceptions.cc (test for excess errors)
Excess errors:
/tmp/trunk/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/istream.tcc:50:
warning: this 'if' clause does not guard... [-Wmisleading-indentation]
This one is suspicious.

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (10 preceding siblings ...)
  2022-01-24  6:02 ` rimvydas.jas at gmail dot com
@ 2022-01-24 12:23 ` redi at gcc dot gnu.org
  2022-01-24 12:34 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-24 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

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

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The warning is correct, because with -fno-exceptions the try-block expands to:

  if (__in.good())
    if (true)  // expanded from __try
      {
        // ...
      }
    if (false) // expanded from __catch(__cxxabiv1::__forced_unwind&)
      {
        // ...
      }
    if (false) // expanded from __catch(...)
      {
        // ...
      }

And as the warning says, the if (false) condition is indented as though part of
the outer if-statement.

The code is actually fine, but it would break if we ever added an else to the
outer if:

  if (__in.good())
    __try
      {
        // ...
      }
    __catch(__cxxabiv1::__forced_unwind&)
      {
        // ...
      }
    __catch(...)
      {
        // ...
      }
  else  // uh-oh, binds to the last __catch


It's probably safest to add braces around the try-block.

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (11 preceding siblings ...)
  2022-01-24 12:23 ` redi at gcc dot gnu.org
@ 2022-01-24 12:34 ` redi at gcc dot gnu.org
  2022-01-25 21:09 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2022-01-24 12:34 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |61596

--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Rimvydas (RJ) from comment #8)
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/
> shared_ptr_base.h: In member function 'void
> std::_Sp_counted_array_base<_Alloc>::_M_init(typename
> std::allocator_traits<_Alloc>::value_type*, _Init)':
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/
> shared_ptr_base.h:767: warning: typedef 'using value_type = using _Up =
> typename std::allocator_traits<_Alloc>::value_type' locally defined but not
> used [-Wunused-local-typedefs]
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/
> shared_ptr_base.h:768: warning: typedef 'using difference_type =
> std::ptrdiff_t' locally defined but not used [-Wunused-local-typedefs]
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/
> shared_ptr_base.h:771: warning: typedef 'using iterator_category = struct
> std::forward_iterator_tag' locally defined but not used
> [-Wunused-local-typedefs]

These warnings are bogus, those typedefs are not "local" because they are
members of a local class, and they are 100% necessary. This is PR 61596.


> In file included from
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-
> dragonfly6.3/bits/stdc++.h:144:
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/latch: In
> member function 'void std::latch::count_down(std::ptrdiff_t)':
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/latch:65:
> warning: comparison of integer expressions of different signedness: 'const
> long unsigned int' and 'std::ptrdiff_t' {aka 'long int'} [-Wsign-compare]

This would fix it, but needs checking carefully:

--- a/libstdc++-v3/include/std/latch
+++ b/libstdc++-v3/include/std/latch
@@ -60,9 +60,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     _GLIBCXX_ALWAYS_INLINE void
     count_down(ptrdiff_t __update = 1)
     {
+      __glibcxx_assert(__update >= 0);
+
       auto const __old = __atomic_impl::fetch_sub(&_M_a,
-                                   __update, memory_order::release);
-      if (__old == __update)
+                                                 __update,
+                                                 memory_order::release);
+      if (__old == static_cast<__detail::__platform_wait_t>(__update))
        __atomic_impl::notify_all(&_M_a);
     }


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61596
[Bug 61596] -Wunused-local-typedefs warns incorrectly on a typedef that's
referenced indirectly

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (12 preceding siblings ...)
  2022-01-24 12:34 ` redi at gcc dot gnu.org
@ 2022-01-25 21:09 ` cvs-commit at gcc dot gnu.org
  2022-05-06  8:32 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-25 21:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:5c1f274e3e090ee03bedc22dd7169b28e759974e

commit r12-6868-g5c1f274e3e090ee03bedc22dd7169b28e759974e
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Jan 25 10:22:42 2022 +0000

    libstdc++: Avoid some more warnings [PR104019]

    With -fno-exceptions we get a -Wmisleading-indentation warning for:

      if (cond)
        __try {}
        __catch (...) {}

    This is because the __catch(...) expands to if (false), but is indented
    as though it is controlled by the preceding 'if'. Surround it in braces.

    The new make_shared<T[]> code triggers a bogus warning due to PR 61596,
    which can be disabled with a pragma.

    libstdc++-v3/ChangeLog:

            PR libstdc++/104019
            * include/bits/istream.tcc (basic_istream::sentry): Add braces
            around try-block.
            * include/bits/shared_ptr_base.h (_Sp_counted_array_base::_M_init):
            Add pragmas to disable bogus warnings from PR 61596.

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (13 preceding siblings ...)
  2022-01-25 21:09 ` cvs-commit at gcc dot gnu.org
@ 2022-05-06  8:32 ` jakub at gcc dot gnu.org
  2022-05-20 10:06 ` redi at gcc dot gnu.org
  2023-05-08 12:23 ` rguenth at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-06  8:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.0                        |12.2

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 12.1 is being released, retargeting bugs to GCC 12.2.

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (14 preceding siblings ...)
  2022-05-06  8:32 ` jakub at gcc dot gnu.org
@ 2022-05-20 10:06 ` redi at gcc dot gnu.org
  2023-05-08 12:23 ` rguenth at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2022-05-20 10:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Apart from the bogus warnings caused by PR 61596, I think only the std::latch
problem remains. Comment 11 has a suggestion for that.

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

* [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
  2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
                   ` (15 preceding siblings ...)
  2022-05-20 10:06 ` redi at gcc dot gnu.org
@ 2023-05-08 12:23 ` rguenth at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-05-08 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.3                        |12.4

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 12.3 is being released, retargeting bugs to GCC 12.4.

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

end of thread, other threads:[~2023-05-08 12:23 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-14  6:06 [Bug libstdc++/104019] New: Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures rimvydas.jas at gmail dot com
2022-01-15  8:58 ` [Bug libstdc++/104019] " pinskia at gcc dot gnu.org
2022-01-15  9:36 ` redi at gcc dot gnu.org
2022-01-15 12:22 ` redi at gcc dot gnu.org
2022-01-15 12:23 ` redi at gcc dot gnu.org
2022-01-21 13:55 ` redi at gcc dot gnu.org
2022-01-21 16:08 ` cvs-commit at gcc dot gnu.org
2022-01-21 16:10 ` redi at gcc dot gnu.org
2022-01-23 22:49 ` cvs-commit at gcc dot gnu.org
2022-01-23 22:54 ` redi at gcc dot gnu.org
2022-01-24  5:57 ` rimvydas.jas at gmail dot com
2022-01-24  6:02 ` rimvydas.jas at gmail dot com
2022-01-24 12:23 ` redi at gcc dot gnu.org
2022-01-24 12:34 ` redi at gcc dot gnu.org
2022-01-25 21:09 ` cvs-commit at gcc dot gnu.org
2022-05-06  8:32 ` jakub at gcc dot gnu.org
2022-05-20 10:06 ` redi at gcc dot gnu.org
2023-05-08 12:23 ` 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).