summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-03 14:56:53 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-03 14:56:53 +0000
commit0a4cd568b37db01d1dc2c160935faee75561aa37 (patch)
treecd3c3578717b3ddf37c3ceddfbcd16e8ecd43868 /gcc/tree-ssa-ccp.c
parentfb14449c7c426053a7909a94720c2499d80dc516 (diff)
downloadgcc-0a4cd568b37db01d1dc2c160935faee75561aa37.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178499 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index fc8d74780ea..fc59d386cad 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;