[Bug c++/108266] [13 Regression] ICE during cxx_eval_constant_expression on IMPLICIT_CONV_EXPR since r13-4564

2023-01-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108266

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:01ea66a6c56e53163d9430f4d87615d570848aa8

commit r13-5075-g01ea66a6c56e53163d9430f4d87615d570848aa8
Author: Jakub Jelinek 
Date:   Mon Jan 9 23:41:20 2023 +0100

c++: Only do maybe_init_list_as_range optimization if
!processing_template_decl [PR108047]

The last testcase in this patch ICEs, because
maybe_init_list_as_range -> maybe_init_list_as_array
calls maybe_constant_init in:
  /* Don't do this if the conversion would be constant.  */
  first = maybe_constant_init (first);
  if (TREE_CONSTANT (first))
return NULL_TREE;
but maybe_constant_init shouldn't be called when processing_template_decl.
While we could replace that call with fold_non_dependent_init, my limited
understanding is that this is an optimization and even if we don't optimize
it when processing_template_decl, build_user_type_conversion_1 will be
called again during instantiation with !processing_template_decl if it is
every instantiated and we can do the optimization only then.

2023-01-09  Jakub Jelinek  

PR c++/105838
PR c++/108047
PR c++/108266
* call.cc (maybe_init_list_as_range): Always return NULL_TREE if
processing_template_decl.

* g++.dg/tree-ssa/initlist-opt2.C: New test.
* g++.dg/tree-ssa/initlist-opt3.C: New test.

[Bug c++/108266] [13 Regression] ICE during cxx_eval_constant_expression on IMPLICIT_CONV_EXPR since r13-4564

2023-01-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108266

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #1 from Andrew Pinski  ---
Dup of bug 108047

*** This bug has been marked as a duplicate of bug 108047 ***

[Bug c++/108266] [13 Regression] ICE during cxx_eval_constant_expression on IMPLICIT_CONV_EXPR since r13-4564

2023-01-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108266

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org
   Last reconfirmed||2023-01-02
   Target Milestone|--- |13.0
 Status|UNCONFIRMED |NEW
   Priority|P3  |P1
 Ever confirmed|0   |1