slight bugfix
[libfirm] / ir / be / bespill.c
index 477101b..2656953 100644 (file)
@@ -14,6 +14,7 @@
 #include "irnode_t.h"
 #include "ircons_t.h"
 #include "iredges_t.h"
+#include "irprintf.h"
 #include "ident_t.h"
 #include "type_t.h"
 #include "entity_t.h"
@@ -237,7 +238,7 @@ static void spill_irn(spill_env_t *env, spill_info_t *spillinfo) {
        /* Trying to spill an already spilled value, no need for a new spill
         * node then, we can simply connect to the same one for this reload
         *
-        * (although rematerialisation code should handle most of these cases
+        * (although rematerialization code should handle most of these cases
         * this can still happen when spilling Phis)
         */
        if(be_is_Reload(to_spill)) {
@@ -245,6 +246,13 @@ static void spill_irn(spill_env_t *env, spill_info_t *spillinfo) {
                return;
        }
 
+       if (arch_irn_is(env->arch_env, to_spill, dont_spill)) {
+               if (env->chordal_env->opts->vrfy_option == BE_CH_VRFY_WARN)
+                       ir_fprintf(stderr, "Verify warning: spilling 'dont_spill' node %+F\n", to_spill);
+               else if (env->chordal_env->opts->vrfy_option == BE_CH_VRFY_ASSERT)
+                       assert(0 && "Attempt to spill a node marked 'dont_spill'");
+       }
+
        spillinfo->spill = be_spill(env->arch_env, to_spill);
        sched_add_after_insn(to_spill, spillinfo->spill);
 }