[Bug c++/108047] [13 Regression] ICE: unexpected expression of kind implicit_conv_expr since r13-4564-gd081807d8d70e3e8

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

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #13 from Jakub Jelinek  ---
I think so.

[Bug c++/108047] [13 Regression] ICE: unexpected expression of kind implicit_conv_expr since r13-4564-gd081807d8d70e3e8

2023-01-23 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108047

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #12 from Marek Polacek  ---
Fixed?

[Bug c++/108047] [13 Regression] ICE: unexpected expression of kind implicit_conv_expr since r13-4564-gd081807d8d70e3e8

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

--- Comment #11 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++/108047] [13 Regression] ICE: unexpected expression of kind implicit_conv_expr since r13-4564-gd081807d8d70e3e8

2023-01-06 Thread slyfox at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108047

--- Comment #10 from Sergei Trofimovich  ---
(In reply to Jakub Jelinek from comment #8)
> Created attachment 54201 [details]
> gcc13-pr108047.patch
> 
> My current understanding is that even if nothing in the initializer is
> dependent maybe_init_list_as_range will be called again during instantiation
> with
> !processing_template_decl and because this is just an optimization, I think
> it should be fine to do the optimization only if !processing_template_decl.

The patch fixes toml library build for me. Thank you!

[Bug c++/108047] [13 Regression] ICE: unexpected expression of kind implicit_conv_expr since r13-4564-gd081807d8d70e3e8

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||lukaszcz18 at wp dot pl

--- Comment #9 from Andrew Pinski  ---
*** Bug 108319 has been marked as a duplicate of this bug. ***

[Bug c++/108047] [13 Regression] ICE: unexpected expression of kind implicit_conv_expr since r13-4564-gd081807d8d70e3e8

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

--- Comment #8 from Jakub Jelinek  ---
Created attachment 54201
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54201=edit
gcc13-pr108047.patch

My current understanding is that even if nothing in the initializer is
dependent maybe_init_list_as_range will be called again during instantiation
with
!processing_template_decl and because this is just an optimization, I think
it should be fine to do the optimization only if !processing_template_decl.

[Bug c++/108047] [13 Regression] ICE: unexpected expression of kind implicit_conv_expr since r13-4564-gd081807d8d70e3e8

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

Andrew Pinski  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #7 from Andrew Pinski  ---
*** Bug 108266 has been marked as a duplicate of this bug. ***

[Bug c++/108047] [13 Regression] ICE: unexpected expression of kind implicit_conv_expr since r13-4564-gd081807d8d70e3e8

2022-12-21 Thread slyfox at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108047

--- Comment #6 from Sergei Trofimovich  ---
Encountered very similar ICE, this time on toml library on this week's gcc-13
master. Reduced it down to the following:

// $ cat bug.cc
#include 
#include 
void format_underline(std::vector);

template 
void parse_key_value_pair(void) { format_underline({""}); }

$ g++ -c bug.cc
...
bug.cc: In function 'void parse_key_value_pair()':
bug.cc:7:51: internal compiler error: unexpected expression
'(std::__cxx11::basic_string)""' of kind implicit_conv_expr
7 | void parse_key_value_pair(void) { format_underline({""}); }
  |   ^~
0x1cbb294 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char
const*, __va_list_tag (*) [1], diagnostic_t)
???:0
0x1cbbee6 internal_error(char const*, ...)
???:0
0x79c770 cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
???:0
0x7a1572 cxx_eval_outermost_constant_expr(tree_node*, bool, bool, bool, bool,
tree_node*)
???:0
0x7a52e6 maybe_constant_init_1(tree_node*, tree_node*, bool, bool)
???:0
0x77a767 build_user_type_conversion_1(tree_node*, tree_node*, int, int)
???:0

[Bug c++/108047] [13 Regression] ICE: unexpected expression of kind implicit_conv_expr since r13-4564-gd081807d8d70e3e8

2022-12-21 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108047

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug c++/108047] [13 Regression] ICE: unexpected expression of kind implicit_conv_expr since r13-4564-gd081807d8d70e3e8

2022-12-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108047

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |13.0
   Keywords||ice-on-valid-code

[Bug c++/108047] [13 Regression] ICE: unexpected expression of kind implicit_conv_expr since r13-4564-gd081807d8d70e3e8

2022-12-12 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108047

Martin Liška  changed:

   What|Removed |Added

Summary|[13 Regression] ice:|[13 Regression] ICE:
   |unexpected expression of|unexpected expression of
   |kind implicit_conv_expr |kind implicit_conv_expr
   ||since
   ||r13-4564-gd081807d8d70e3e8
 Status|UNCONFIRMED |NEW
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1
   Last reconfirmed||2022-12-12

--- Comment #5 from Martin Liška  ---
Started with r13-4564-gd081807d8d70e3e8.