diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-02-19 19:30:22 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-02-19 19:30:22 +0100 |
commit | e19bcb67dd5942d598c282427f91437166dd565d (patch) | |
tree | db800fe98bd9a288ba2a6bd2ff267e530c78e46d /gcc/ipa-struct-reorg.c | |
parent | 8ac074e8e2e321aa7e73d416f4e598a2be89e8cd (diff) | |
download | gcc-e19bcb67dd5942d598c282427f91437166dd565d.zip gcc-e19bcb67dd5942d598c282427f91437166dd565d.tar.gz gcc-e19bcb67dd5942d598c282427f91437166dd565d.tar.bz2 |
re PR debug/43084 (ICE -fipa-struct-reorg -g (VTA))
PR debug/43084
* ipa-struct-reorg.c (add_access_to_acc_sites): For debug stmts don't
populate vars array.
(create_new_general_access): For debug stmts just reset value.
(get_stmt_accesses): For accesses within debug stmts just record them
using add_access_to_acc_sites instead of preventing the peeling or
counting them as accesses.
* gcc.dg/pr43084.c: New test.
From-SVN: r156904
Diffstat (limited to 'gcc/ipa-struct-reorg.c')
-rw-r--r-- | gcc/ipa-struct-reorg.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/gcc/ipa-struct-reorg.c b/gcc/ipa-struct-reorg.c index bef303e..66b3ab4 100644 --- a/gcc/ipa-struct-reorg.c +++ b/gcc/ipa-struct-reorg.c @@ -1,5 +1,5 @@ /* Struct-reorg optimization. - Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Olga Golovanevsky <olga@il.ibm.com> (Initial version of this code was developed by Caroline Tice and Mostafa Hagog.) @@ -497,13 +497,16 @@ add_access_to_acc_sites (gimple stmt, tree var, htab_t accs) acc = (struct access_site *) xmalloc (sizeof (struct access_site)); acc->stmt = stmt; - acc->vars = VEC_alloc (tree, heap, 10); + if (!is_gimple_debug (stmt)) + acc->vars = VEC_alloc (tree, heap, 10); + else + acc->vars = NULL; slot = htab_find_slot_with_hash (accs, stmt, htab_hash_pointer (stmt), INSERT); *slot = acc; - } - VEC_safe_push (tree, heap, acc->vars, var); + if (!is_gimple_debug (stmt)) + VEC_safe_push (tree, heap, acc->vars, var); } /* This function adds NEW_DECL to function @@ -1383,6 +1386,13 @@ create_new_general_access (struct access_site *acc, d_str str) create_new_stmts_for_cond_expr (stmt); break; + case GIMPLE_DEBUG: + /* It is very hard to maintain usable debug info after struct peeling, + for now just reset all debug stmts referencing objects that have + been peeled. */ + gimple_debug_bind_reset_value (stmt); + break; + default: create_new_stmts_for_general_acc (acc, str); } @@ -2494,6 +2504,15 @@ get_stmt_accesses (tree *tp, int *walk_subtrees, void *data) if (i != VEC_length (structure, structures)) { + if (is_gimple_debug (stmt)) + { + d_str str; + + str = VEC_index (structure, structures, i); + add_access_to_acc_sites (stmt, NULL, str->accs); + *walk_subtrees = 0; + break; + } if (dump_file) { fprintf (dump_file, "\nThe type "); @@ -2525,6 +2544,13 @@ get_stmt_accesses (tree *tp, int *walk_subtrees, void *data) struct field_entry * field = find_field_in_struct (str, field_decl); + if (is_gimple_debug (stmt)) + { + add_access_to_acc_sites (stmt, NULL, str->accs); + *walk_subtrees = 0; + break; + } + if (field) { struct field_access_site *acc = make_field_acc_node (); |