public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104622] New: [12 Regression] ICE in compare_ics, at cp/call.cc:11419
@ 2022-02-21 21:28 gscfq@t-online.de
  2022-02-22  0:35 ` [Bug c++/104622] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2022-02-21 21:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104622
           Summary: [12 Regression] ICE in compare_ics, at
                    cp/call.cc:11419
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Changed between 20210822 and 20210905 :
(variations of g++.dg/warn/Winvalid-memory-model*)


$ cat z1.cc
#include <atomic>
static const std::memory_order relaxed = std::memory_order_relaxed;
extern std::atomic<int> eai;
void test_compare_exchange (int pi, int *pj)
{
#define cmpxchg(x, y, z, o1, o2) \
  std::atomic_compare_exchange_weak_explicit (x, y, z, o1, o2)
  cmpxchg (&eai, pi++, *pj++, relaxed, relaxed);


$ cat z2.cc
#include <atomic>
static const std::memory_order relaxed = std::memory_order_relaxed;
extern std::atomic<int> eai;
void test_compare_exchange (int *pi, int *pj)
{
#define cmpxchg(x, y, z, o1, o2) \
  std::atomic_compare_exchange_weak_explicit (x, -1, z, o1, o2)
  cmpxchg (&eai, pi++, *pj++, relaxed, relaxed);


$ cat z3.cc
#include <atomic>
static const std::memory_order relaxed = std::memory_order_relaxed;
static const std::memory_order consume = std::memory_order_consume;
extern std::atomic<int> eai;
void test_compare_exchange (int *pi, int *pj)
{
#define cmpxchg(x, y, z, o1, o2) \
  std::atomic_compare_exchange_weak_explicit (x, y, z, o1, o2)
  cmpxchg (&eai,*pj++,*pj++, relaxed, consume);


$ g++-12-20220220 -c z1.cc
z1.cc: In function 'void test_compare_exchange(int, int*)':
z1.cc:7:46: internal compiler error: Segmentation fault
    7 |   std::atomic_compare_exchange_weak_explicit (x, y, z, o1, o2)
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
z1.cc:8:3: note: in expansion of macro 'cmpxchg'
    8 |   cmpxchg (&eai, pi++, *pj++, relaxed, relaxed);
      |   ^~~~~~~
0xda25ef crash_signal
        ../../gcc/toplev.cc:322
0x6d06ee compare_ics
        ../../gcc/cp/call.cc:11419
0x6d747a joust
        ../../gcc/cp/call.cc:12083
0x6d857d tourney
        ../../gcc/cp/call.cc:12523
0x6d86c6 perform_overload_resolution
        ../../gcc/cp/call.cc:4718
0x6dd4b2 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ../../gcc/cp/call.cc:4816
0x85c0c0 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ../../gcc/cp/semantics.cc:2870
0x7f33af cp_parser_postfix_expression
        ../../gcc/cp/parser.cc:7878
0x805841 cp_parser_unary_expression
        ../../gcc/cp/parser.cc:9035
0x7dcc5f cp_parser_cast_expression
        ../../gcc/cp/parser.cc:9939
0x7dd492 cp_parser_binary_expression
        ../../gcc/cp/parser.cc:10041
0x7ddbe0 cp_parser_assignment_expression
        ../../gcc/cp/parser.cc:10345
0x7dea6c cp_parser_expression
        ../../gcc/cp/parser.cc:10515
0x7e1587 cp_parser_expression_statement
        ../../gcc/cp/parser.cc:12711
0x7eecf1 cp_parser_statement
        ../../gcc/cp/parser.cc:12507
0x7efcb4 cp_parser_statement_seq_opt
        ../../gcc/cp/parser.cc:12856
0x7efd6f cp_parser_compound_statement
        ../../gcc/cp/parser.cc:12808
0x80de98 cp_parser_function_body
        ../../gcc/cp/parser.cc:25062
0x80de98 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/cp/parser.cc:25113
0x80e356 cp_parser_function_definition_after_declarator
        ../../gcc/cp/parser.cc:31243

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

* [Bug c++/104622] [12 Regression] ICE in compare_ics, at cp/call.cc:11419
  2022-02-21 21:28 [Bug c++/104622] New: [12 Regression] ICE in compare_ics, at cp/call.cc:11419 gscfq@t-online.de
@ 2022-02-22  0:35 ` pinskia at gcc dot gnu.org
  2022-02-22 10:30 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-22  0:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
           Keywords|                            |needs-bisection,
                   |                            |needs-reduction

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

* [Bug c++/104622] [12 Regression] ICE in compare_ics, at cp/call.cc:11419
  2022-02-21 21:28 [Bug c++/104622] New: [12 Regression] ICE in compare_ics, at cp/call.cc:11419 gscfq@t-online.de
  2022-02-22  0:35 ` [Bug c++/104622] " pinskia at gcc dot gnu.org
@ 2022-02-22 10:30 ` rguenth at gcc dot gnu.org
  2022-02-22 19:34 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-22 10:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug c++/104622] [12 Regression] ICE in compare_ics, at cp/call.cc:11419
  2022-02-21 21:28 [Bug c++/104622] New: [12 Regression] ICE in compare_ics, at cp/call.cc:11419 gscfq@t-online.de
  2022-02-22  0:35 ` [Bug c++/104622] " pinskia at gcc dot gnu.org
  2022-02-22 10:30 ` rguenth at gcc dot gnu.org
@ 2022-02-22 19:34 ` mpolacek at gcc dot gnu.org
  2022-03-02 20:59 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-02-22 19:34 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-02-22
                 CC|                            |mpolacek at gcc dot gnu.org,
                   |                            |ppalka at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r12-3346-g47543e5f9d1fc502be79f91c87cbeb6eda17e641

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

* [Bug c++/104622] [12 Regression] ICE in compare_ics, at cp/call.cc:11419
  2022-02-21 21:28 [Bug c++/104622] New: [12 Regression] ICE in compare_ics, at cp/call.cc:11419 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-02-22 19:34 ` mpolacek at gcc dot gnu.org
@ 2022-03-02 20:59 ` mpolacek at gcc dot gnu.org
  2022-03-03  2:39 ` ppalka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-03-02 20:59 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Since this looks to be an ICE on invalid, I'm downgrading it to P2.

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

* [Bug c++/104622] [12 Regression] ICE in compare_ics, at cp/call.cc:11419
  2022-02-21 21:28 [Bug c++/104622] New: [12 Regression] ICE in compare_ics, at cp/call.cc:11419 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2022-03-02 20:59 ` mpolacek at gcc dot gnu.org
@ 2022-03-03  2:39 ` ppalka at gcc dot gnu.org
  2022-03-12 20:02 ` cvs-commit at gcc dot gnu.org
  2022-03-12 20:07 ` ppalka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-03-03  2:39 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

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

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

* [Bug c++/104622] [12 Regression] ICE in compare_ics, at cp/call.cc:11419
  2022-02-21 21:28 [Bug c++/104622] New: [12 Regression] ICE in compare_ics, at cp/call.cc:11419 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2022-03-03  2:39 ` ppalka at gcc dot gnu.org
@ 2022-03-12 20:02 ` cvs-commit at gcc dot gnu.org
  2022-03-12 20:07 ` ppalka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-12 20:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:03c83cf7aa1110e427beb00ea95767dfaf50d694

commit r12-7632-g03c83cf7aa1110e427beb00ea95767dfaf50d694
Author: Patrick Palka <ppalka@redhat.com>
Date:   Sat Mar 12 15:00:49 2022 -0500

    c++: ICE with bad conversion shortcutting [PR104622]

    When shortcutting bad argument conversions during overload resolution,
    we assume conversions get computed in sequential order and that therefore
    the conversion array is incomplete iff the last conversion is missing.
    But this assumption turns out to be wrong for templates, because during
    deduction check_non_deducible_conversion can compute an argument
    conversion out of order.

    So in the testcase below, at the end of add_template_candidate the
    conversion array looks like {bad_conv, NULL, good_conv} where the last
    conversion was computed during deduction and the first one later from
    add_function_candidate.  We need to add this candidate to bad_fns since
    not all of its argument conversions were computed, but we don't do so
    because the last conversion isn't missing.

    This patch fixes this by checking for a missing conversion exhaustively
    instead.  In passing, this cleans up check_non_deducible_conversion given
    that the only values of 'strict' we expect to see here the enumerators
    of unification_kind_t.

            PR c++/104622

    gcc/cp/ChangeLog:

            * call.cc (missing_conversion_p): Define.
            (add_candidates): Use it.
            * pt.cc (check_non_deducible_conversion): Change type of strict
            parameter to unification_kind_t and directly test for DEDUCE_CALL.

    gcc/testsuite/ChangeLog:

            * g++.dg/template/conv18.C: New test.

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

* [Bug c++/104622] [12 Regression] ICE in compare_ics, at cp/call.cc:11419
  2022-02-21 21:28 [Bug c++/104622] New: [12 Regression] ICE in compare_ics, at cp/call.cc:11419 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2022-03-12 20:02 ` cvs-commit at gcc dot gnu.org
@ 2022-03-12 20:07 ` ppalka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-03-12 20:07 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

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

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2022-03-12 20:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21 21:28 [Bug c++/104622] New: [12 Regression] ICE in compare_ics, at cp/call.cc:11419 gscfq@t-online.de
2022-02-22  0:35 ` [Bug c++/104622] " pinskia at gcc dot gnu.org
2022-02-22 10:30 ` rguenth at gcc dot gnu.org
2022-02-22 19:34 ` mpolacek at gcc dot gnu.org
2022-03-02 20:59 ` mpolacek at gcc dot gnu.org
2022-03-03  2:39 ` ppalka at gcc dot gnu.org
2022-03-12 20:02 ` cvs-commit at gcc dot gnu.org
2022-03-12 20:07 ` ppalka 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).