public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108390] New: ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types
@ 2023-01-13  0:47 ed at catmur dot uk
  2023-01-13  1:08 ` [Bug c++/108390] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ed at catmur dot uk @ 2023-01-13  0:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108390
           Summary: ICE in fold_convert_loc, at fold-const.cc:2504 partial
                    ordering between array types
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ed at catmur dot uk
  Target Milestone: ---

template<class T, T t> long f(int(*)[t], T(*)[t]);
template<class T, int i> int f(int(*)[i], T(*)[i]);
int n = f<int, 2>(0, 0);

<source>:4:18: internal compiler error: in fold_convert_loc, at
fold-const.cc:2504
    4 | int n = f<int, 2>(0, 0);
      |         ~~~~~~~~~^~~~~~
0x23975be internal_error(char const*, ...)
        ???:0
0xa693ae fancy_abort(char const*, int, char const*)
        ???:0
0xc99848 more_specialized_fn(tree_node*, tree_node*, int)
        ???:0
0xa97529 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ???:0
0xcb6fd4 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ???:0
0xc43be7 c_parse_file()
        ???:0
0xd7fd79 c_common_parse_file()
        ???:0

Godbolt says this is bad back to 8.1; before that it was ambiguous.

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

* [Bug c++/108390] ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types
  2023-01-13  0:47 [Bug c++/108390] New: ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types ed at catmur dot uk
@ 2023-01-13  1:08 ` pinskia at gcc dot gnu.org
  2023-01-13  1:19 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-13  1:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
MSVC considers this ambigous just like older versions of GCC:

<source>(3): error C2668: 'f': ambiguous call to overloaded function
<source>(2): note: could be 'int f<int,2>(int (*)[2],T (*)[2])'
        with
        [
            T=int
        ]
<source>(1): note: or       'long f<int,2>(int (*)[2],T (*)[2])'
        with
        [
            T=int
        ]
<source>(3): note: while trying to match the argument list '(int, int)'

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

* [Bug c++/108390] ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types
  2023-01-13  0:47 [Bug c++/108390] New: ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types ed at catmur dot uk
  2023-01-13  1:08 ` [Bug c++/108390] " pinskia at gcc dot gnu.org
@ 2023-01-13  1:19 ` pinskia at gcc dot gnu.org
  2023-01-13  8:15 ` [Bug c++/108390] ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types since r8-4678-g6296cf8e099aae43 marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-13  1:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-01-13
     Ever confirmed|0                           |1
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=79092

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I suspect the patch for PR79092 cahnged the behavior in GCC 8.

I don't see how this can't be ambiguous. It is odd that clang accepts it.

This C++20 testcase also causes the ICE and clang rejects it as ambiguous:

```
template<auto t> long f(int(*)[t], int(*)[t]);
template<int i> int f(int(*)[i], int(*)[i]);
int n = f<2>(0, 0);
```

So at least ICE on invalid.

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

* [Bug c++/108390] ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types since r8-4678-g6296cf8e099aae43
  2023-01-13  0:47 [Bug c++/108390] New: ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types ed at catmur dot uk
  2023-01-13  1:08 ` [Bug c++/108390] " pinskia at gcc dot gnu.org
  2023-01-13  1:19 ` pinskia at gcc dot gnu.org
@ 2023-01-13  8:15 ` marxin at gcc dot gnu.org
  2023-01-13  9:24 ` [Bug c++/108390] [10/11/12/13 Regression] " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-01-13  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE in fold_convert_loc, at |ICE in fold_convert_loc, at
                   |fold-const.cc:2504 partial  |fold-const.cc:2504 partial
                   |ordering between array      |ordering between array
                   |types                       |types since
                   |                            |r8-4678-g6296cf8e099aae43
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Started to ICE with r8-4678-g6296cf8e099aae43.

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

* [Bug c++/108390] [10/11/12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types since r8-4678-g6296cf8e099aae43
  2023-01-13  0:47 [Bug c++/108390] New: ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types ed at catmur dot uk
                   ` (2 preceding siblings ...)
  2023-01-13  8:15 ` [Bug c++/108390] ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types since r8-4678-g6296cf8e099aae43 marxin at gcc dot gnu.org
@ 2023-01-13  9:24 ` jakub at gcc dot gnu.org
  2023-03-22 19:30 ` cvs-commit at gcc dot gnu.org
  2023-07-07 10:44 ` [Bug c++/108390] [11/12 " rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-13  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |10.5
           Priority|P3                          |P2
            Summary|ICE in fold_convert_loc, at |[10/11/12/13 Regression]
                   |fold-const.cc:2504 partial  |ICE in fold_convert_loc, at
                   |ordering between array      |fold-const.cc:2504 partial
                   |types since                 |ordering between array
                   |r8-4678-g6296cf8e099aae43   |types since
                   |                            |r8-4678-g6296cf8e099aae43

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

* [Bug c++/108390] [10/11/12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types since r8-4678-g6296cf8e099aae43
  2023-01-13  0:47 [Bug c++/108390] New: ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types ed at catmur dot uk
                   ` (3 preceding siblings ...)
  2023-01-13  9:24 ` [Bug c++/108390] [10/11/12/13 Regression] " jakub at gcc dot gnu.org
@ 2023-03-22 19:30 ` cvs-commit at gcc dot gnu.org
  2023-07-07 10:44 ` [Bug c++/108390] [11/12 " rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-22 19:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

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

commit r13-6813-g5a1717fbdfd1242a5beb3ac8300766a3534d3f88
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Mar 22 11:12:57 2023 -0400

    c++: array bound partial ordering [PR108390]

    fold_convert doesn't work with a dependent argument, and problematically
    differed from the corresponding fold+build_nop further down in the
    function.  So change it to match.

            PR c++/108390

    gcc/cp/ChangeLog:

            * pt.cc (unify): Use fold of build_nop instead of fold_convert.

    gcc/testsuite/ChangeLog:

            * g++.dg/template/partial-order3.C: New test.

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

* [Bug c++/108390] [11/12 Regression] ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types since r8-4678-g6296cf8e099aae43
  2023-01-13  0:47 [Bug c++/108390] New: ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types ed at catmur dot uk
                   ` (4 preceding siblings ...)
  2023-03-22 19:30 ` cvs-commit at gcc dot gnu.org
@ 2023-07-07 10:44 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

end of thread, other threads:[~2023-07-07 10:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13  0:47 [Bug c++/108390] New: ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types ed at catmur dot uk
2023-01-13  1:08 ` [Bug c++/108390] " pinskia at gcc dot gnu.org
2023-01-13  1:19 ` pinskia at gcc dot gnu.org
2023-01-13  8:15 ` [Bug c++/108390] ICE in fold_convert_loc, at fold-const.cc:2504 partial ordering between array types since r8-4678-g6296cf8e099aae43 marxin at gcc dot gnu.org
2023-01-13  9:24 ` [Bug c++/108390] [10/11/12/13 Regression] " jakub at gcc dot gnu.org
2023-03-22 19:30 ` cvs-commit at gcc dot gnu.org
2023-07-07 10:44 ` [Bug c++/108390] [11/12 " 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).