Skip to content
Snippets Groups Projects
Commit 60ad1e40 authored by Jakub Jelinek's avatar Jakub Jelinek Committed by Jakub Jelinek
Browse files

gimplify: Small RAW_DATA_CST gimplification fix

I've noticed the following testcase hangs during gimplification.

While it is gimplifying an assignment from a VAR_DECL .LCNNN to MEM_REF,
because the VAR_DECL is TREE_READONLY, it will happily pick its initializer
and try to gimplify that, which means recursing to the exact same code.

The following patch fixes that by just gimplifying the lhs and building
assignment, because the code decided that it should use copying from
a static var.

2024-10-16  Jakub Jelinek  <jakub@redhat.com>

	* gimplify.cc (gimplify_init_ctor_eval): For larger RAW_DATA_CST,
	just gimplify cref as lvalue and add gimple assignment of rctor
	to cref instead of going through gimplification of INIT_EXPR, as
	the latter can suffer from infinite recursion.

	* c-c++-common/cpp/embed-24.c: New test.
parent 1844a4aa
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment