Commit b158b5c6 by Alon Dayan Committed by Olga Golovanevsky

re PR middle-end/34701 (ICE in tree-ssa-ccp.c with -fipa-struct-reorg)

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.

Co-Authored-By: Olga Golovanevsky <olga@il.ibm.com>

From-SVN: r131689
parent b8ce93da
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.
2008-01-20 Kenneth Zadeck <zadeck@naturalbridge.com> 2008-01-20 Kenneth Zadeck <zadeck@naturalbridge.com>
* doc/install.texi: Add doc for --enable-checking=df. * doc/install.texi: Add doc for --enable-checking=df.
......
...@@ -623,7 +623,12 @@ gen_size (tree num, tree type, tree *res) ...@@ -623,7 +623,12 @@ gen_size (tree num, tree type, tree *res)
add_referenced_var (*res); add_referenced_var (*res);
if (exact_log2 (struct_size_int) == -1) 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 else
{ {
tree C = build_int_cst (TREE_TYPE (num), exact_log2 (struct_size_int)); tree C = build_int_cst (TREE_TYPE (num), exact_log2 (struct_size_int));
......
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-20 Paolo Carlini <pcarlini@suse.de> 2008-01-20 Paolo Carlini <pcarlini@suse.de>
PR c++/34891 PR c++/34891
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct basic
{
int a;
int b[10];
} type_struct;
type_struct *str1;
int main()
{
int i;
str1 = malloc (10 * sizeof (type_struct));
for (i=0; i<=9; i++)
str1[i].a = str1[i].b[0];
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" } } */
/* { dg-final { cleanup-ipa-dump "*" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment