From 957f47e6c874633c8a15b93793a314a86c5ab0b1 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Thu, 16 Oct 2014 17:06:34 -0400 Subject: [PATCH] lto-object.c (lto_obj_begin_section): In the event that pointer sizes aren't powers of two... * lto-object.c (lto_obj_begin_section): In the event that pointer sizes aren't powers of two, choose a more suitable alignment than (unsigned)(-1). From-SVN: r216350 --- gcc/lto/ChangeLog | 6 ++++++ gcc/lto/lto-object.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 7ae4d8a54a3..5b80db8eefb 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2014-10-16 DJ Delorie + + * lto-object.c (lto_obj_begin_section): In the event that pointer + sizes aren't powers of two, choose a more suitable alignment + than (unsigned)(-1). + 2014-10-14 DJ Delorie * lto-lang.c (lto_build_c_type_nodes): Check intN types for diff --git a/gcc/lto/lto-object.c b/gcc/lto/lto-object.c index 323f7b2a74e..8e26079d309 100644 --- a/gcc/lto/lto-object.c +++ b/gcc/lto/lto-object.c @@ -338,7 +338,7 @@ lto_obj_begin_section (const char *name) && lo->sobj_w != NULL && lo->section == NULL); - align = exact_log2 (POINTER_SIZE / BITS_PER_UNIT); + align = ceil_log2 (POINTER_SIZE_UNITS); lo->section = simple_object_write_create_section (lo->sobj_w, name, align, &errmsg, &err); if (lo->section == NULL) -- 2.30.2