diff options
author | olga <olga@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-21 09:07:12 +0000 |
---|---|---|
committer | olga <olga@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-21 09:07:12 +0000 |
commit | f25ba2cf7d7b1ff2e3ad85d3d4454f9a266b59f1 (patch) | |
tree | 0e7ce94084774885f2271b72843dc3ab47004225 /gcc/ipa-struct-reorg.c | |
parent | 2d7085a5deeb287fd0313c4e10a1cff9e338ada1 (diff) | |
download | gcc-f25ba2cf7d7b1ff2e3ad85d3d4454f9a266b59f1.tar.gz |
2008-01-21 Alon Dayan <alond@il.ibm.com>
Olga Golovanevsky <olga@il.ibm.com>
PR tree-optimization/34701
* gcc.dg/struct/wo_prof_array_field.c: New test.
2008-01-21 Alon Dayan <alond@il.ibm.com>
Olga Golovanevsky <olga@il.ibm.com>
PR tree-optimization/34701
* ipa-struct-reorg.c (gen_size): Fix the malloc parameter calculation
when the structure size is not a power of 2.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131689 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-struct-reorg.c')
-rw-r--r-- | gcc/ipa-struct-reorg.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ipa-struct-reorg.c b/gcc/ipa-struct-reorg.c index be60a21e46f..0619576e732 100644 --- a/gcc/ipa-struct-reorg.c +++ b/gcc/ipa-struct-reorg.c @@ -623,7 +623,12 @@ gen_size (tree num, tree type, tree *res) add_referenced_var (*res); if (exact_log2 (struct_size_int) == -1) - new_stmt = build_gimple_modify_stmt (num, struct_size); + { + tree size = build_int_cst (TREE_TYPE (num), struct_size_int); + new_stmt = build_gimple_modify_stmt (*res, build2 (MULT_EXPR, + TREE_TYPE (num), + num, size)); + } else { tree C = build_int_cst (TREE_TYPE (num), exact_log2 (struct_size_int)); |