fixed precedence constraint
[libfirm] / ir / be / beirgmod.c
index 4fbbc06..28d86e1 100644 (file)
@@ -1,3 +1,17 @@
+/**
+ * This file contains the following IRG modifications for be routines:
+ * - backend dominance information
+ * - SSA construction for a set of nodes
+ * - insertion of Perm nodes
+ * - empty block elimination
+ * - a simple dead node elimination (set inputs of unreachable nodes to BAD)
+ *
+ * Author:      Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig
+ * Date:        04.05.2005
+ * Copyright:   (c) Universitaet Karlsruhe
+ * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ * CVS-Id:      $Id$
+ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -362,9 +376,11 @@ static void fix_usages(pset *copies, pset *copy_blocks, pset *phi_blocks, pset *
        for (irn = pset_first(copies); irn; irn = pset_next(copies)) {
                const ir_edge_t *edge;
                foreach_out_edge(irn, edge) {
-                       if (!pset_find_ptr(ignore_uses, get_edge_src_irn(edge))) {
+                       ir_node *src = get_edge_src_irn(edge);
+                       /* ignore all users from ignore_uses or keep-alives (user is End node) */
+                       if (! pset_find_ptr(ignore_uses, src) && ! is_End(src)) {
                                struct out tmp;
-                               tmp.irn = get_edge_src_irn(edge);
+                               tmp.irn = src;
                                tmp.pos = get_edge_src_pos(edge);
                                obstack_grow(&obst, &tmp, sizeof(tmp));
                                n_outs++;
@@ -438,7 +454,7 @@ static void remove_odd_phis(pset *copies, pset *unused_copies)
                sched_remove(irn);
        }
 }
-#endif
+#endif /* if 0 */
 
 void be_ssa_constr_phis_ignore(be_dom_front_info_t *info, be_lv_t *lv, int n, ir_node *nodes[], pset *phis, pset *ignore_uses)
 {