This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Fix PR optimization/12825
- From: Diego Novillo <dnovillo at redhat dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 31 Oct 2003 08:04:20 -0500
- Subject: [tree-ssa] Fix PR optimization/12825
- Organization: Red Hat Canada
I knew my theory of DOM2 not ever exposing new symbols was going to bite
me in the rear.
Bootstrapped and tested x86. This fixes PR 12825 and its duplicate(s).
Diego.
Fix PR optimization/12825
* tree-optimize.c (optimize_function_tree): Run SSA renamer after
second DOM pass.
testsuite/ChangeLog.tree-ssa:
* gcc.dg/tree-ssa/20031031-1.c: New test.
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 1.1.4.63
diff -d -c -p -r1.1.4.63 tree-optimize.c
*** tree-optimize.c 27 Oct 2003 01:31:59 -0000 1.1.4.63
--- tree-optimize.c 31 Oct 2003 12:54:36 -0000
*************** optimize_function_tree (tree fndecl)
*** 160,166 ****
/* There should not be any new symbols exposed. */
if (sbitmap_first_set_bit (vars_to_rename) >= 0)
! abort ();
}
/* Run copy propagation. */
--- 160,166 ----
/* There should not be any new symbols exposed. */
if (sbitmap_first_set_bit (vars_to_rename) >= 0)
! rewrite_into_ssa (fndecl, vars_to_rename, TDI_ssa_5);
}
/* Run copy propagation. */
Index: testsuite/gcc.dg/tree-ssa/20031031-1.c
===================================================================
RCS file: testsuite/gcc.dg/tree-ssa/20031031-1.c
diff -N testsuite/gcc.dg/tree-ssa/20031031-1.c
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.dg/tree-ssa/20031031-1.c 31 Oct 2003 12:54:58 -0000
***************
*** 0 ****
--- 1,14 ----
+ /* This program requires the SSA renamer to be run after the second DOM
+ pass. Test provided by Falk Hueffner as Bugzilla #12825. */
+
+ struct floppy_raw_cmd {
+ int flags, track;
+ } *raw_cmd, default_raw_cmd;
+
+ void
+ setup_format_params (void)
+ {
+ raw_cmd = &default_raw_cmd;
+ raw_cmd->track = 0;
+ raw_cmd->flags = 0;
+ }