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
+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
+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
--- /dev/null
+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);
+}
+
/* 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. */
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 ();
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);
}
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);
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);