summaryrefslogtreecommitdiffhomepage
path: root/ir/be/begnuas.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-09-18 17:02:53 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2016-09-18 22:49:58 +0200
commit9efd8c48a59864ceccaf96587f5992080111cbf3 (patch)
tree7a03f0db08adce723ae3fb1a4f63c2e2eefeb42a /ir/be/begnuas.c
parenta4c2839c9c204f3784a753b74cb1d6141a7f5b43 (diff)
be: Add and use 'be_mode_needs_gp_reg()'.
Diffstat (limited to 'ir/be/begnuas.c')
-rw-r--r--ir/be/begnuas.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ir/be/begnuas.c b/ir/be/begnuas.c
index 624712f..561a0ed 100644
--- a/ir/be/begnuas.c
+++ b/ir/be/begnuas.c
@@ -19,6 +19,7 @@
#include "beemithlp.h"
#include "beemitter.h"
#include "bemodule.h"
+#include "betranshlp.h"
#include "dbginfo.h"
#include "entity_t.h"
#include "execfreq.h"
@@ -740,7 +741,7 @@ static void emit_init_expression(ir_node *const init)
return;
case iro_Add:
- if (!mode_is_int(mode) && !mode_is_reference(mode))
+ if (!be_mode_needs_gp_reg(mode))
panic("constant must be int or pointer for '+' to work");
emit_init_expression(get_Add_left(init));
be_emit_cstring(" + ");
@@ -748,7 +749,7 @@ static void emit_init_expression(ir_node *const init)
return;
case iro_Sub:
- if (!mode_is_int(mode) && !mode_is_reference(mode))
+ if (!be_mode_needs_gp_reg(mode))
panic("constant must be int or pointer for '-' to work");
emit_init_expression(get_Sub_left(init));
be_emit_cstring(" - ");