diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-09-03 14:56:53 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-09-03 14:56:53 +0000 |
commit | 13868f4049616f5ac73bb89ce38474ada50ff28c (patch) | |
tree | cd3c3578717b3ddf37c3ceddfbcd16e8ecd43868 /gcc/tree-ssa-ccp.c | |
parent | 1822c31f05cbcece4d73aa95ec824bd0086af445 (diff) | |
download | gcc-13868f4049616f5ac73bb89ce38474ada50ff28c.zip gcc-13868f4049616f5ac73bb89ce38474ada50ff28c.tar.gz gcc-13868f4049616f5ac73bb89ce38474ada50ff28c.tar.bz2 |
cfgexpand.c (add_stack_var): Assert that the alignment is not zero.
* cfgexpand.c (add_stack_var): Assert that the alignment is not zero.
* tree-ssa-ccp.c (fold_builtin_alloca_for_var): Revert latest change.
Force at least BITS_PER_UNIT alignment on the new variable.
From-SVN: r178499
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index fc8d747..fc59d38 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1708,8 +1708,6 @@ fold_builtin_alloca_for_var (gimple stmt) return NULL_TREE; size = TREE_INT_CST_LOW (arg); - if (size == 0) - return NULL_TREE; /* Heuristic: don't fold large vlas. */ threshold = (unsigned HOST_WIDE_INT)PARAM_VALUE (PARAM_LARGE_STACK_FRAME); @@ -1726,6 +1724,8 @@ fold_builtin_alloca_for_var (gimple stmt) elem_type = build_nonstandard_integer_type (BITS_PER_UNIT, 1); n_elem = size * 8 / BITS_PER_UNIT; align = MIN (size * 8, BIGGEST_ALIGNMENT); + if (align < BITS_PER_UNIT) + align = BITS_PER_UNIT; array_type = build_array_type_nelts (elem_type, n_elem); var = create_tmp_var (array_type, NULL); DECL_ALIGN (var) = align; |