Fixed and simplified rot matcher
[libfirm] / ir / be / begnuas.c
index bcb41c5..42d9e2a 100644 (file)
@@ -271,15 +271,22 @@ static void dump_arith_tarval(tarval *tv, int bytes)
 /**
  * Return the label prefix for labeled blocks.
  */
-const char *be_gas_label_prefix(void) {
+const char *be_gas_block_label_prefix(void) {
        return ".LG";
 }
 
+/**
+ * Return the label prefix for labeled instructions.
+ */
+const char *be_gas_insn_label_prefix(void) {
+       return ".LE";
+}
+
 /**
  * Dump a label.
  */
 static void dump_label(ir_label_t label) {
-       be_emit_irprintf("%s%ld", be_gas_label_prefix(), label);
+       be_emit_irprintf("%s%lu", be_gas_block_label_prefix(), label);
 }
 
 /**
@@ -416,18 +423,27 @@ static void do_dump_atomic_init(be_gas_decl_env_t *env, ir_node *init)
                return;
 
                case iro_Add:
+                       if (!mode_is_int(mode) && !mode_is_reference(mode)) {
+                               panic("Constant must be int or pointer for '+' to work");
+                       }
                        do_dump_atomic_init(env, get_Add_left(init));
                        be_emit_cstring(" + ");
                        do_dump_atomic_init(env, get_Add_right(init));
                        return;
 
                case iro_Sub:
+                       if (!mode_is_int(mode) && !mode_is_reference(mode)) {
+                               panic("Constant must be int or pointer for '-' to work");
+                       }
                        do_dump_atomic_init(env, get_Sub_left(init));
                        be_emit_cstring(" - ");
                        do_dump_atomic_init(env, get_Sub_right(init));
                        return;
 
                case iro_Mul:
+                       if (!mode_is_int(mode) && !mode_is_reference(mode)) {
+                               panic("Constant must be int or pointer for '*' to work");
+                       }
                        do_dump_atomic_init(env, get_Mul_left(init));
                        be_emit_cstring(" * ");
                        do_dump_atomic_init(env, get_Mul_right(init));