This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Avoid needless unsharing during constexpr evaluation (PR c++/70452)


On 2016.04.06 at 18:25 -0400, Patrick Palka wrote:
> On Wed, 6 Apr 2016, Patrick Palka wrote:
> Here is a safer and simpler approach that just walks the expression
> being unshared to try to find a CONSTRUCTOR node.  If it finds one, then
> we unshare the whole expression.  Otherwise we return the original
> expression.  It should be completely safe to avoid unsharing an
> expression if it contains no CONSTRUCTOR nodes.
> 
> gcc/cp/ChangeLog:
> 
> 	PR c++/70452
> 	* constexpr.c (find_constructor): New function.
> 	(unshare_constructor): New function.
> 	(cxx_eval_call_expression): Use unshare_constructor instead of
> 	unshare_expr.
> 	(find_array_ctor_elt): Likewise.
> 	(cxx_eval_vec_init_1): Likewise.
> 	(cxx_eval_store_expression): Likewise.
> 	(cxx_eval_constant_expression): Likewise.

This patch causes: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70590

-- 
Markus


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]