lto-object.c (lto_obj_begin_section): In the event that pointer sizes aren't powers...
authorDJ Delorie <dj@redhat.com>
Thu, 16 Oct 2014 21:06:34 +0000 (17:06 -0400)
committerDJ Delorie <dj@gcc.gnu.org>
Thu, 16 Oct 2014 21:06:34 +0000 (17:06 -0400)
* 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
gcc/lto/lto-object.c

index 7ae4d8a54a3dce481cf72cf6bc4c1b3777074567..5b80db8eefb81ee475da837f8fc61bc9132ff8e7 100644 (file)
@@ -1,3 +1,9 @@
+2014-10-16  DJ Delorie  <dj@redhat.com>
+
+       * 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  <dj@redhat.com>
 
        * lto-lang.c (lto_build_c_type_nodes): Check intN types for
index 323f7b2a74eb3c323ee9f3783b21c7cf9ae63df9..8e26079d30971ed882f08339ce2c9116e9533843 100644 (file)
@@ -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)