[Bug c++/109556] [13/14 Regression] internal compiler error: in iterative_hash_template_arg, at cp/pt.cc:1927

2023-04-19 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109556

Patrick Palka  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Patrick Palka  ---
Fixed for GCC 13.1, thanks for the bug report.

FWIW a potential workaround for this bug, which seems to work for me at least,
is to remove the Magnitude constraint from to_prefix_base and
to_base_scaled_unit.

[Bug c++/109556] [13/14 Regression] internal compiler error: in iterative_hash_template_arg, at cp/pt.cc:1927

2023-04-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109556

--- Comment #8 from CVS Commits  ---
The releases/gcc-13 branch has been updated by Patrick Palka
:

https://gcc.gnu.org/g:90361bc6f4edb444e86380b6d1e08475fa74

commit r13-7227-g90361bc6f4edb444e86380b6d1e08475fa74
Author: Patrick Palka 
Date:   Wed Apr 19 13:07:46 2023 -0400

c++: bad ggc_free in try_class_unification [PR109556]

Aside from correcting how try_class_unification copies multi-dimensional
'targs', r13-377-g3e948d645bc908 also made it ggc_free this copy as an
optimization.  But this is wrong since the call to unify within might've
captured the args in persistent memory such as the satisfaction cache
(as part of constrained auto deduction).

PR c++/109556

gcc/cp/ChangeLog:

* pt.cc (try_class_unification): Don't ggc_free the copy of
'targs'.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-placeholder13.C: New test.

(cherry picked from commit 5e284ebbc3082c5a8974d24e3a0977aa48f3cc60)

[Bug c++/109556] [13/14 Regression] internal compiler error: in iterative_hash_template_arg, at cp/pt.cc:1927

2023-04-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109556

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Patrick Palka :

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

commit r14-91-g5e284ebbc3082c5a8974d24e3a0977aa48f3cc60
Author: Patrick Palka 
Date:   Wed Apr 19 13:07:46 2023 -0400

c++: bad ggc_free in try_class_unification [PR109556]

Aside from correcting how try_class_unification copies multi-dimensional
'targs', r13-377-g3e948d645bc908 also made it ggc_free this copy as an
optimization.  But this is wrong since the call to unify within might've
captured the args in persistent memory such as the satisfaction cache
(as part of constrained auto deduction).

PR c++/109556

gcc/cp/ChangeLog:

* pt.cc (try_class_unification): Don't ggc_free the copy of
'targs'.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-placeholder13.C: New test.

[Bug c++/109556] [13/14 Regression] internal compiler error: in iterative_hash_template_arg, at cp/pt.cc:1927

2023-04-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109556

--- Comment #6 from Jakub Jelinek  ---
Indeed, the reduction got stuck at around 1.4M size and didn't reduce further
until I've killed it.

[Bug c++/109556] [13/14 Regression] internal compiler error: in iterative_hash_template_arg, at cp/pt.cc:1927

2023-04-19 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109556

Patrick Palka  changed:

   What|Removed |Added

   Keywords|needs-bisection,|
   |needs-reduction |

--- Comment #5 from Patrick Palka  ---
template
concept C = (N != 0);

template
struct A { };

template auto M>
void f(A);

int main() {
  f(A<1, 42>{});
  f(A<2, 42>{});
}

Bisection seems unreliable probably due to the use-after-free nature of the
bug, but removing those calls to ggc_free fixes the issue so
r13-377-g3e948d645bc908 is almost certainly the culprit.

[Bug c++/109556] [13/14 Regression] internal compiler error: in iterative_hash_template_arg, at cp/pt.cc:1927

2023-04-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109556

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2023-04-19
 Status|UNCONFIRMED |ASSIGNED
   Target Milestone|--- |13.0
   Keywords||GC, ice-on-valid-code
 Ever confirmed|0   |1
Summary|internal compiler error: in |[13/14 Regression] internal
   |iterative_hash_template_arg |compiler error: in
   |, at cp/pt.cc:1927  |iterative_hash_template_arg
   ||, at cp/pt.cc:1927