2010-02-19 Jakub Jelinek <jakub@redhat.com>
+ 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.
+
PR middle-end/42233
* dojump.c (do_jump) <case TRUTH_NOT_EXPR>: Invert priority.
/* 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.)
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
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);
}
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 ");
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 ();