summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bejit.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-02-13 20:27:54 +0100
committerMatthias Braun <matze@braunis.de>2016-02-13 20:47:39 +0100
commitdada81acdc6376be5dbe66118fcd28d25ca11902 (patch)
tree49fe0e092bfb0a24c06de8c865935ca7c54e1e1b /ir/be/bejit.c
parent206f8441e918c355160fd80c783d37f8a7e88be0 (diff)
Use round_up2() more often and cleanup its implementation
Diffstat (limited to 'ir/be/bejit.c')
-rw-r--r--ir/be/bejit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ir/be/bejit.c b/ir/be/bejit.c
index 2fdb1aa..5ba375d 100644
--- a/ir/be/bejit.c
+++ b/ir/be/bejit.c
@@ -18,6 +18,7 @@
#include "array.h"
#include "beemitter.h"
#include "begnuas.h"
+#include "bitfiddle.h"
#include "compiler.h"
#include "entity_t.h"
#include "obst.h"
@@ -117,9 +118,8 @@ static void layout_fragments(ir_jit_function_t *const function,
assert(fragment->address == ~0u);
assert(fragment->len != ~0u);
- unsigned const align = 1 << fragment->p2align;
- unsigned const align_mask = ~(align-1);
- unsigned const aligned = (address + align - 1) & align_mask;
+ unsigned const align = 1 << fragment->p2align;
+ unsigned const aligned = round_up2(address, align);
if (aligned - address <= fragment->max_skip)
address = aligned;