summaryrefslogtreecommitdiff
path: root/gcc/varpool.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/varpool.c')
-rw-r--r--gcc/varpool.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/varpool.c b/gcc/varpool.c
index 3d1ab690dcb..5bfb0a7c867 100644
--- a/gcc/varpool.c
+++ b/gcc/varpool.c
@@ -221,6 +221,8 @@ varpool_node::dump (FILE *f)
fprintf (f, " output");
if (used_by_single_function)
fprintf (f, " used-by-single-function");
+ if (need_bounds_init)
+ fprintf (f, " need-bounds-init");
if (TREE_READONLY (decl))
fprintf (f, " read-only");
if (ctor_useable_for_folding_p ())
@@ -390,6 +392,12 @@ ctor_for_folding (tree decl)
&& TREE_CODE (decl) != CONST_DECL)
return error_mark_node;
+ /* Static constant bounds are created to be
+ used instead of constants and therefore
+ do not let folding it. */
+ if (POINTER_BOUNDS_P (decl))
+ return error_mark_node;
+
if (TREE_CODE (decl) == CONST_DECL
|| DECL_IN_CONSTANT_POOL (decl))
return DECL_INITIAL (decl);