allow character mode constants
[libfirm] / ir / be / bespillslots.c
index 2b3ece6..c107ce5 100644 (file)
@@ -5,7 +5,7 @@
  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
  */
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
 #endif
 
 #include <stdlib.h>
@@ -28,6 +28,7 @@
 #include "benodesets.h"
 #include "bestatevent.h"
 #include "bespilloptions.h"
+#include "bemodule.h"
 
 #define DBG_COALESCING         1
 #define DBG_INTERFERENCES      2
@@ -280,9 +281,18 @@ static void do_greedy_coalescing(be_fec_env_t *env)
 
        // construct interferences
        for(i = 0; i < spillcount; ++i) {
+               ir_node *spill1 = spilllist[i]->spill;
+               if(is_NoMem(spill1))
+                       continue;
+
                for(i2 = i+1; i2 < spillcount; ++i2) {
-                       if(values_interfere(lv, spilllist[i]->spill, spilllist[i2]->spill)) {
-                               DBG((dbg, DBG_INTERFERENCES, "Slot %d and %d interfere\n", i, i2));
+                       ir_node *spill2 = spilllist[i2]->spill;
+                       if(is_NoMem(spill2))
+                               continue;
+
+                       if(values_interfere(lv, spill1, spill2)) {
+                               DBG((dbg, DBG_INTERFERENCES, "Slot %d and %d interfere\n",
+                                    i, i2));
                                bitset_set(interferences[i], i2);
                                bitset_set(interferences[i2], i);
                        }
@@ -522,7 +532,8 @@ static void assign_spillslots(be_fec_env_t *env)
                                }
                        }
                } else {
-                       arch_set_frame_entity(arch_env, node, slot->entity);
+                       if(!is_NoMem(node))
+                               arch_set_frame_entity(arch_env, node, slot->entity);
                }
        }
 
@@ -640,7 +651,6 @@ be_fec_env_t *be_new_frame_entity_coalescer(be_irg_t *birg)
        env->reloads = NEW_ARR_F(ir_node*, 0);
        env->affinity_edges = NEW_ARR_F(affinity_edge_t*, 0);
        env->memperms = new_set(cmp_memperm, 10);
-       FIRM_DBG_REGISTER(dbg, "firm.be.spillslots");
 
        return env;
 }
@@ -714,3 +724,10 @@ void be_coalesce_spillslots(be_irg_t *birg)
 
        be_free_frame_entity_coalescer(env);
 }
+
+void be_init_spillslots(void)
+{
+       FIRM_DBG_REGISTER(dbg, "firm.be.spillslots");
+}
+
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillslots);