summaryrefslogtreecommitdiffhomepage
path: root/ir/be/begnuas.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-02-15 08:07:19 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2016-02-15 09:02:20 +0100
commite440f83664814997ec7b6455e15b227a18001ef4 (patch)
treebeb3372bf561c1e3d9eca0fd8638feb6c2a98aaa /ir/be/begnuas.c
parent20aee4d54aab760aefeeb024a8b88f0a7d72f2cf (diff)
cleanup: Query value only when it is needed.
Diffstat (limited to 'ir/be/begnuas.c')
-rw-r--r--ir/be/begnuas.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ir/be/begnuas.c b/ir/be/begnuas.c
index 5456fe6..bd56a50 100644
--- a/ir/be/begnuas.c
+++ b/ir/be/begnuas.c
@@ -731,7 +731,6 @@ const char *be_gas_insn_label_prefix(void)
static void emit_init_expression(ir_node *const init)
{
ir_mode *mode = get_irn_mode(init);
- int bytes = get_mode_size_bytes(mode);
switch (get_irn_opcode(init)) {
case iro_Conv:
@@ -739,8 +738,9 @@ static void emit_init_expression(ir_node *const init)
return;
case iro_Const: {
- ir_tarval *tv = get_Const_tarval(init);
/* it's an arithmetic value */
+ int const bytes = get_mode_size_bytes(mode);
+ ir_tarval *const tv = get_Const_tarval(init);
emit_tv(tv, 0, bytes);
return;
}