summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 2dc505a35eb..f5afc0da292 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -3862,10 +3862,19 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
individual element initialization. Also don't do this for small
all-zero initializers (which aren't big enough to merit
clearing), and don't try to make bitwise copies of
- TREE_ADDRESSABLE types. */
+ TREE_ADDRESSABLE types.
+
+ We cannot apply such transformation when compiling chkp static
+ initializer because creation of initializer image in the memory
+ will require static initialization of bounds for it. It should
+ result in another gimplification of similar initializer and we
+ may fall into infinite loop. */
if (valid_const_initializer
&& !(cleared || num_nonzero_elements == 0)
- && !TREE_ADDRESSABLE (type))
+ && !TREE_ADDRESSABLE (type)
+ && (!current_function_decl
+ || !lookup_attribute ("chkp ctor",
+ DECL_ATTRIBUTES (current_function_decl))))
{
HOST_WIDE_INT size = int_size_in_bytes (type);
unsigned int align;