public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67762] New: [C++1z] 'not a constant expression" errors only with -fsanitize=undefined
Date: Tue, 29 Sep 2015 12:28:00 -0000	[thread overview]
Message-ID: <bug-67762-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 67762
           Summary: [C++1z] 'not a constant expression" errors only with
                    -fsanitize=undefined
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org
                CC: mpolacek at gcc dot gnu.org
  Target Milestone: ---

Created attachment 36415
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36415&action=edit
unreduced testcase

The attached testcase compiles fine without -fsanitize=undefined.

markus@x4 test % g++ -c -std=c++1z -Wall -Wextra variant.ii
markus@x4 test % g++ -c -fsanitize=undefined -std=c++1z -Wall -Wextra
variant.ii
/var/tmp/cmcstl2/test/variant.cpp: In function ‘void
{anonymous}::test_visit()’:
/var/tmp/cmcstl2/test/variant.cpp:886:5: error: non-constant condition for
static assertion
     static_assert(visit(f, V{42}, V{42}) == 84ull);
     ^
In file included from /var/tmp/cmcstl2/include/stl2/variant.hpp:30:0,
                 from /var/tmp/cmcstl2/test/variant.cpp:16:
/var/tmp/cmcstl2/test/variant.cpp:886:24:   in constexpr expansion of
‘std::experimental::ranges_v1::__variant::visit<std::plus<void>&,
{std::experimental::ranges_v1::variant
<int, unsigned int, long int, long unsigned int, long long int, long long
unsigned int>, std::experimental::ranges_v1::variant<int, unsigned int, long
int, long unsigned int,
 long long int, long long unsigned int>}>(f,
std::experimental::ranges_v1::variant<int, unsigned int, long int, long
unsigned int, long long int, long long unsigned int>(42),
 std::experimental::ranges_v1::variant<int, unsigned int, long int, long
unsigned int, long long int, long long unsigned int>(42))’
/var/tmp/cmcstl2/include/stl2/detail/variant/visit.hpp:414:32:   in constexpr
expansion of
‘std::experimental::ranges_v1::__variant::visit_with_indices<std::experimental::ran
ges_v1::__variant::no_index_visitor<std::plus<void>&>,
{std::experimental::ranges_v1::variant<int, unsigned int, long int, long
unsigned int, long long int, long long unsigne
d int>, std::experimental::ranges_v1::variant<int, unsigned int, long int, long
unsigned int, long long int, long long unsigned int>}>((*(UBSAN_NULL((&
std::experimental::ran
ges_v1::__variant::no_index_visitor<std::plus<void>&>{(*(UBSAN_NULL((&
std::forward<std::plus<void>&>((*(UBSAN_NULL((& f), 2u, 0u), (& f))))), 2u,
0u), (& std::forward<std::p
lus<void>&>((*(UBSAN_NULL((& f), 2u, 0u), (& f)))))))}), 2u, 8u), (&
std::experimental::ranges_v1::__variant::no_index_visitor<std::plus<void>&>{(*(UBSAN_NULL((&
std::forward
<std::plus<void>&>((*(UBSAN_NULL((& f), 2u, 0u), (& f))))), 2u, 0u), (&
std::forward<std::plus<void>&>((*(UBSAN_NULL((& f), 2u, 0u), (& f)))))))}))),
(*(UBSAN_NULL((& std::fo
rward<std::experimental::ranges_v1::variant<int, unsigned int, long int, long
unsigned int, long long int, long long unsigned int> >((*(UBSAN_NULL((& vs#0),
2u, 8u), (& vs#0)
)))), 2u, 8u), (& std::forward<std::experimental::ranges_v1::variant<int,
unsigned int, long int, long unsigned int, long long int, long long unsigned
int> >((*(UBSAN_NULL((&
 vs#0), 2u, 8u), (& vs#0))))))), (*(UBSAN_NULL((&
std::forward<std::experimental::ranges_v1::variant<int, unsigned int, long int,
long unsigned int, long long int, long long 
unsigned int> >((*(UBSAN_NULL((& vs#1), 2u, 8u), (& vs#1))))), 2u, 8u), (&
std::forward<std::experimental::ranges_v1::variant<int, unsigned int, long int,
long unsigned int, 
long long int, long long unsigned int> >((*(UBSAN_NULL((& vs#1), 2u, 8u), (&
vs#1))))))))’
/var/tmp/cmcstl2/include/stl2/detail/variant/visit.hpp:388:36:   in constexpr
expansion of
‘std::experimental::ranges_v1::__variant::raw_visit_with_indices<std::experimental:
:ranges_v1::__variant::cooked_visitor<std::experimental::ranges_v1::__variant::no_index_visitor<std::plus<void>&>,
std::experimental::ranges_v1::variant<int, unsigned int, lo
ng int, long unsigned int, long long int, long long unsigned int>,
std::experimental::ranges_v1::variant<int, unsigned int, long int, long
unsigned int, long long int, long l
ong unsigned int> >, {std::experimental::ranges_v1::variant<int, unsigned int,
long int, long unsigned int, long long int, long long unsigned int>,
std::experimental::ranges_
v1::variant<int, unsigned int, long int, long unsigned int, long long int, long
long unsigned int>}>((*(UBSAN_NULL((&
std::experimental::ranges_v1::__variant::cooked_visitor<
std::experimental::ranges_v1::__variant::no_index_visitor<std::plus<void>&>,
std::experimental::ranges_v1::variant<int, unsigned int, long int, long
unsigned int, long long i
nt, long long unsigned int>, std::experimental::ranges_v1::variant<int,
unsigned int, long int, long unsigned int, long long int, long long unsigned
int> >{(*(UBSAN_NULL((& s
td::forward<std::experimental::ranges_v1::__variant::no_index_visitor<std::plus<void>&>
>((*(UBSAN_NULL((& f), 2u, 8u), (& f))))), 2u, 8u), (&
std::forward<std::experimental:
:ranges_v1::__variant::no_index_visitor<std::plus<void>&> >((*(UBSAN_NULL((&
f), 2u, 8u), (& f)))))))}), 2u, 8u), (&
std::experimental::ranges_v1::__variant::cooked_visitor<s
td::experimental::ranges_v1::__variant::no_index_visitor<std::plus<void>&>,
std::experimental::ranges_v1::variant<int, unsigned int, long int, long
unsigned int, long long in
t, long long unsigned int>, std::experimental::ranges_v1::variant<int, unsigned
int, long int, long unsigned int, long long int, long long unsigned int>
>{(*(UBSAN_NULL((& st
d::forward<std::experimental::ranges_v1::__variant::no_index_visitor<std::plus<void>&>
>((*(UBSAN_NULL((& f), 2u, 8u), (& f))))), 2u, 8u), (&
std::forward<std::experimental::
ranges_v1::__variant::no_index_visitor<std::plus<void>&> >((*(UBSAN_NULL((& f),
2u, 8u), (& f)))))))}))), (*(UBSAN_NULL((&
std::forward<std::experimental::ranges_v1::variant<
int, unsigned int, long int, long unsigned int, long long int, long long
unsigned int> >((*(UBSAN_NULL((& vs#0), 2u, 8u), (& vs#0))))), 2u, 8u), (&
std::forward<std::experime
ntal::ranges_v1::variant<int, unsigned int, long int, long unsigned int, long
long int, long long unsigned int> >((*(UBSAN_NULL((& vs#0), 2u, 8u), (&
vs#0))))))), (*(UBSAN_NU
LL((& std::forward<std::experimental::ranges_v1::variant<int, unsigned int,
long int, long unsigned int, long long int, long long unsigned int>
>((*(UBSAN_NULL((& vs#1), 2u, 
8u), (& vs#1))))), 2u, 8u), (&
std::forward<std::experimental::ranges_v1::variant<int, unsigned int, long int,
long unsigned int, long long int, long long unsigned int> >((*(
UBSAN_NULL((& vs#1), 2u, 8u), (& vs#1))))))))’
/var/tmp/cmcstl2/include/stl2/detail/variant/visit.hpp:300:13: error:
‘(std::experimental::ranges_v1::__variant::o1_visit_handler<std::integer_sequence<long
unsigned int, 0ul
, 0ul>,
std::experimental::ranges_v1::__variant::cooked_visitor<std::experimental::ranges_v1::__variant::no_index_visitor<std::plus<void>&>,
std::experimental::ranges_v1::var
iant<int, unsigned int, long int, long unsigned int, long long int, long long
unsigned int>, std::experimental::ranges_v1::variant<int, unsigned int, long
int, long unsigned 
int, long long int, long long unsigned int> >,
{std::experimental::ranges_v1::variant<int, unsigned int, long int, long
unsigned int, long long int, long long unsigned int>, 
std::experimental::ranges_v1::variant<int, unsigned int, long int, long
unsigned int, long long int, long long unsigned int>}> == 0u)’ is not a
constant expression
       STL2_CONSTEXPR_ASSUME(Dispatch::table[i]);
             ^
...
>From gcc-bugs-return-498294-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Sep 29 12:54:44 2015
Return-Path: <gcc-bugs-return-498294-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24472 invoked by alias); 29 Sep 2015 12:54:43 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19397 invoked by uid 55); 29 Sep 2015 12:54:38 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/65393] std::thread shared_ptr inefficiency
Date: Tue, 29 Sep 2015 12:54:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: redi at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65393-4-7ImpVmDiq2@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65393-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65393-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg02272.txt.bz2
Content-length: 1283

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide393

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Tue Sep 29 12:54:05 2015
New Revision: 228242

URL: https://gcc.gnu.org/viewcvs?rev"8242&root=gcc&view=rev
Log:
Reduce space and time overhead of std::thread

        PR libstdc++/65393
        * config/abi/pre/gnu.ver: Export new symbols.
        * include/std/thread (thread::_State, thread::_State_impl): New types.
        (thread::_M_start_thread): Add overload taking unique_ptr<_State>.
        (thread::_M_make_routine): Remove.
        (thread::_S_make_state): Add.
        (thread::_Impl_base, thread::_Impl, thread::_M_start_thread)
        [_GLIBCXX_THREAD_ABI_COMPAT] Only declare conditionally.
        * src/c++11/thread.cc (execute_native_thread_routine): Rename to
        execute_native_thread_routine_compat and re-define to use _State.
        (thread::_State::~_State()): Define.
        (thread::_M_make_thread): Define new overload.
        (thread::_M_make_thread) [_GLIBCXX_THREAD_ABI_COMPAT]: Only define old
        overloads conditionally.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/config/abi/pre/gnu.ver
    trunk/libstdc++-v3/include/std/thread
    trunk/libstdc++-v3/src/c++11/thread.cc


             reply	other threads:[~2015-09-29 12:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29 12:28 trippels at gcc dot gnu.org [this message]
2015-09-29 13:50 ` [Bug c++/67762] " mpolacek at gcc dot gnu.org
2015-09-29 14:11 ` mpolacek at gcc dot gnu.org
2015-09-29 14:22 ` trippels at gcc dot gnu.org
2015-09-29 17:02 ` trippels at gcc dot gnu.org
2015-09-29 19:25 ` trippels at gcc dot gnu.org
2021-04-27 23:57 ` dushistov at mail dot ru
2021-11-10 13:03 ` curdeius at gmail dot com
2022-12-31 21:44 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-67762-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).