Re: [PATCH] c++: ICE with -fno-elide-constructors and trivial fn [PR101073]

2023-02-20 Thread Jason Merrill via Gcc-patches
On 2/15/23 13:37, Marek Polacek wrote: On Wed, Feb 15, 2023 at 02:39:16PM -0500, Jason Merrill wrote: On 2/9/23 09:39, Marek Polacek wrote: In constexpr-nsdmi3.C, with -fno-elide-constructors, we don't elide the Y::Y(const Y&) call used to initialize o.c. So store_init_value -> cxx_constant_in

Re: [PATCH] c++: ICE with -fno-elide-constructors and trivial fn [PR101073]

2023-02-15 Thread Marek Polacek via Gcc-patches
On Wed, Feb 15, 2023 at 02:39:16PM -0500, Jason Merrill wrote: > On 2/9/23 09:39, Marek Polacek wrote: > > In constexpr-nsdmi3.C, with -fno-elide-constructors, we don't elide > > the Y::Y(const Y&) call used to initialize o.c. So store_init_value > > -> cxx_constant_init must constexpr-evaluate th

Re: [PATCH] c++: ICE with -fno-elide-constructors and trivial fn [PR101073]

2023-02-15 Thread Jason Merrill via Gcc-patches
On 2/9/23 09:39, Marek Polacek wrote: In constexpr-nsdmi3.C, with -fno-elide-constructors, we don't elide the Y::Y(const Y&) call used to initialize o.c. So store_init_value -> cxx_constant_init must constexpr-evaluate the call to Y::Y(const Y&) in cxx_eval_call_expression. It's a trivial funct

[PATCH] c++: ICE with -fno-elide-constructors and trivial fn [PR101073]

2023-02-09 Thread Marek Polacek via Gcc-patches
In constexpr-nsdmi3.C, with -fno-elide-constructors, we don't elide the Y::Y(const Y&) call used to initialize o.c. So store_init_value -> cxx_constant_init must constexpr-evaluate the call to Y::Y(const Y&) in cxx_eval_call_expression. It's a trivial function, so we do the "Shortcut trivial cons