Commit aecd4d81 by Richard Guenther Committed by Richard Biener

re PR debug/42455 ("-fcompare-debug failure" at -O2 in 'recent' builds)

2010-01-01  Richard Guenther  <rguenther@suse.de>

	PR debug/42455
	* tree-sra.c (analyze_all_variable_accesses): Work in DECL_UID
	order.

From-SVN: r155559
parent dadab4fd
2010-01-01 Richard Guenther <rguenther@suse.de> 2010-01-01 Richard Guenther <rguenther@suse.de>
PR debug/42455
* tree-sra.c (analyze_all_variable_accesses): Work in DECL_UID
order.
2010-01-01 Richard Guenther <rguenther@suse.de>
PR c/42570 PR c/42570
* c-decl.c (grokdeclarator): For zero-size arrays force * c-decl.c (grokdeclarator): For zero-size arrays force
structural equality checks as layout_type does. structural equality checks as layout_type does.
......
/* Scalar Replacement of Aggregates (SRA) converts some structure /* Scalar Replacement of Aggregates (SRA) converts some structure
references into scalar references, exposing them to the scalar references into scalar references, exposing them to the scalar
optimizers. optimizers.
Copyright (C) 2008, 2009 Free Software Foundation, Inc. Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Martin Jambor <mjambor@suse.cz> Contributed by Martin Jambor <mjambor@suse.cz>
This file is part of GCC. This file is part of GCC.
...@@ -1885,45 +1885,50 @@ propagate_all_subaccesses (void) ...@@ -1885,45 +1885,50 @@ propagate_all_subaccesses (void)
static bool static bool
analyze_all_variable_accesses (void) analyze_all_variable_accesses (void)
{ {
tree var;
referenced_var_iterator rvi;
int res = 0; int res = 0;
bitmap tmp = BITMAP_ALLOC (NULL);
bitmap_iterator bi;
unsigned i;
FOR_EACH_REFERENCED_VAR (var, rvi) bitmap_copy (tmp, candidate_bitmap);
if (bitmap_bit_p (candidate_bitmap, DECL_UID (var))) EXECUTE_IF_SET_IN_BITMAP (tmp, 0, i, bi)
{ {
struct access *access; tree var = referenced_var (i);
struct access *access;
access = sort_and_splice_var_accesses (var);
if (access) access = sort_and_splice_var_accesses (var);
build_access_trees (access); if (access)
else build_access_trees (access);
disqualify_candidate (var, else
"No or inhibitingly overlapping accesses."); disqualify_candidate (var,
} "No or inhibitingly overlapping accesses.");
}
propagate_all_subaccesses (); propagate_all_subaccesses ();
FOR_EACH_REFERENCED_VAR (var, rvi) bitmap_copy (tmp, candidate_bitmap);
if (bitmap_bit_p (candidate_bitmap, DECL_UID (var))) EXECUTE_IF_SET_IN_BITMAP (tmp, 0, i, bi)
{ {
struct access *access = get_first_repr_for_decl (var); tree var = referenced_var (i);
struct access *access = get_first_repr_for_decl (var);
if (analyze_access_trees (access)) if (analyze_access_trees (access))
{ {
res++; res++;
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
{ {
fprintf (dump_file, "\nAccess trees for "); fprintf (dump_file, "\nAccess trees for ");
print_generic_expr (dump_file, var, 0); print_generic_expr (dump_file, var, 0);
fprintf (dump_file, " (UID: %u): \n", DECL_UID (var)); fprintf (dump_file, " (UID: %u): \n", DECL_UID (var));
dump_access_tree (dump_file, access); dump_access_tree (dump_file, access);
fprintf (dump_file, "\n"); fprintf (dump_file, "\n");
} }
} }
else else
disqualify_candidate (var, "No scalar replacements to be created."); disqualify_candidate (var, "No scalar replacements to be created.");
} }
BITMAP_FREE (tmp);
if (res) if (res)
{ {
......
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