diff options
author | Richard Guenther <rguenther@suse.de> | 2007-12-14 14:21:41 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-12-14 14:21:41 +0000 |
commit | ae4dbd44baaea8b195e792c1865d02e8bf6c36b8 (patch) | |
tree | 21ef4ec05b828e6f1466e7a77d7a896095ce86bf | |
parent | 2c9fd13e905b68909db52d6868645790f935e35a (diff) | |
download | gcc-ae4dbd44baaea8b195e792c1865d02e8bf6c36b8.zip gcc-ae4dbd44baaea8b195e792c1865d02e8bf6c36b8.tar.gz gcc-ae4dbd44baaea8b195e792c1865d02e8bf6c36b8.tar.bz2 |
re PR middle-end/34462 (tree check: expected ssa_name, have struct_field_tag in vuses_compare, at tree-vn.c:118)
2007-12-14 Richard Guenther <rguenther@suse.de>
PR middle-end/34462
* tree-ssa-operands.h (create_ssa_artificial_load_stmt): Add
parameter to say whether to unlink immediate uses.
* tree-ssa-operands.c (create_ssa_artificial_load_stmt): Do not
mark the artificial stmt as modified. Unlink immediate uses
only if requested.
* tree-ssa-dom.c (record_equivalences_from_stmt): Update caller.
* tree-ssa-pre.c (insert_fake_stores): Likewise.
* gcc.c-torture/compile/20071214-1.c: New testcase.
From-SVN: r130931
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/20071214-1.c | 15 | ||||
-rw-r--r-- | gcc/tree-ssa-dom.c | 2 | ||||
-rw-r--r-- | gcc/tree-ssa-operands.c | 17 | ||||
-rw-r--r-- | gcc/tree-ssa-operands.h | 2 | ||||
-rw-r--r-- | gcc/tree-ssa-pre.c | 2 |
7 files changed, 46 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f187e61..8a742f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2007-12-14 Richard Guenther <rguenther@suse.de> + + PR middle-end/34462 + * tree-ssa-operands.h (create_ssa_artificial_load_stmt): Add + parameter to say whether to unlink immediate uses. + * tree-ssa-operands.c (create_ssa_artificial_load_stmt): Do not + mark the artificial stmt as modified. Unlink immediate uses + only if requested. + * tree-ssa-dom.c (record_equivalences_from_stmt): Update caller. + * tree-ssa-pre.c (insert_fake_stores): Likewise. + 2007-12-13 Eric Botcazou <ebotcazou@libertysurf.fr> PR middle-end/33088 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 35c1880..56448f4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-12-14 Richard Guenther <rguenther@suse.de> + + PR middle-end/34462 + * gcc.c-torture/compile/20071214-1.c: New testcase. + 2007-12-14 Uros Bizjak <ubizjak@gmail.com> * gcc.target/i386/sse-14.c (test_1, test_2, test_2x, test_4): New diff --git a/gcc/testsuite/gcc.c-torture/compile/20071214-1.c b/gcc/testsuite/gcc.c-torture/compile/20071214-1.c new file mode 100644 index 0000000..f30af93 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20071214-1.c @@ -0,0 +1,15 @@ +typedef __builtin_va_list va_list; +void gftp_config_parse_args (int numargs, char **first, ...) +{ + char **dest = first; + va_list argp; + __builtin_va_start (argp, first); + while (numargs-- > 0) + { + *dest = __builtin_malloc (1); + dest = __builtin_va_arg(argp, char **); + *dest = ((void *)0); + } + __builtin_va_end(argp); +} + diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index 7bed1c2..bc9809e 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -1618,7 +1618,7 @@ record_equivalences_from_stmt (tree stmt, int may_optimize_p, stmt_ann_t ann) /* Build a new statement with the RHS and LHS exchanged. */ new_stmt = build_gimple_modify_stmt (rhs, lhs); - create_ssa_artificial_load_stmt (new_stmt, stmt); + create_ssa_artificial_load_stmt (new_stmt, stmt, true); /* Finally enter the statement into the available expression table. */ diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index fb61166..72f4433 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -2647,17 +2647,23 @@ copy_virtual_operands (tree dest, tree src) create an artificial stmt which looks like a load from the store, this can be used to eliminate redundant loads. OLD_OPS are the operands from the store stmt, and NEW_STMT is the new load which represents a load of the - values stored. */ + values stored. If DELINK_IMM_USES_P is specified, the immediate + uses of this stmt will be de-linked. */ void -create_ssa_artificial_load_stmt (tree new_stmt, tree old_stmt) +create_ssa_artificial_load_stmt (tree new_stmt, tree old_stmt, + bool delink_imm_uses_p) { tree op; ssa_op_iter iter; use_operand_p use_p; unsigned i; + stmt_ann_t ann; - get_stmt_ann (new_stmt); + /* Create the stmt annotation but make sure to not mark the stmt + as modified as we will build operands ourselves. */ + ann = get_stmt_ann (new_stmt); + ann->modified = 0; /* Process NEW_STMT looking for operands. */ start_ssa_stmt_operands (); @@ -2687,8 +2693,9 @@ create_ssa_artificial_load_stmt (tree new_stmt, tree old_stmt) finalize_ssa_stmt_operands (new_stmt); /* All uses in this fake stmt must not be in the immediate use lists. */ - FOR_EACH_SSA_USE_OPERAND (use_p, new_stmt, iter, SSA_OP_ALL_USES) - delink_imm_use (use_p); + if (delink_imm_uses_p) + FOR_EACH_SSA_USE_OPERAND (use_p, new_stmt, iter, SSA_OP_ALL_USES) + delink_imm_use (use_p); } diff --git a/gcc/tree-ssa-operands.h b/gcc/tree-ssa-operands.h index 4dc344e..f48245f 100644 --- a/gcc/tree-ssa-operands.h +++ b/gcc/tree-ssa-operands.h @@ -210,7 +210,7 @@ extern void free_stmt_operands (tree); extern bool verify_imm_links (FILE *f, tree var); extern void copy_virtual_operands (tree, tree); -extern void create_ssa_artificial_load_stmt (tree, tree); +extern void create_ssa_artificial_load_stmt (tree, tree, bool); extern void dump_immediate_uses (FILE *file); extern void dump_immediate_uses_for (FILE *file, tree var); diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 69dbfb2..6a06b2a 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -3171,7 +3171,7 @@ insert_fake_stores (void) lhs = make_ssa_name (storetemp, new_tree); GIMPLE_STMT_OPERAND (new_tree, 0) = lhs; - create_ssa_artificial_load_stmt (new_tree, stmt); + create_ssa_artificial_load_stmt (new_tree, stmt, false); NECESSARY (new_tree) = 0; VEC_safe_push (tree, heap, inserted_exprs, new_tree); |