public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [lto] don't assume pointer size
@ 2014-10-15 22:16 DJ Delorie
  2014-10-16  8:06 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: DJ Delorie @ 2014-10-15 22:16 UTC (permalink / raw)
  To: gcc-patches


In the event that pointer sizes aren't powers of two, choose a more
suitable alignment than (unsigned)(-1), which results in HUGE file
sizes.  Ok?

Index: gcc/lto/lto-object.c
===================================================================
--- gcc/lto/lto-object.c	(revision 216287)
+++ gcc/lto/lto-object.c	(working copy)
@@ -335,13 +335,13 @@ lto_obj_begin_section (const char *name)
   lo = (struct lto_simple_object *) current_out_file;
   gcc_assert (lo != NULL
 	      && lo->sobj_r == NULL
 	      && 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)
     {
       if (err == 0)
 	fatal_error ("%s", errmsg);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [lto] don't assume pointer size
  2014-10-15 22:16 [lto] don't assume pointer size DJ Delorie
@ 2014-10-16  8:06 ` Richard Biener
  2014-10-16 21:16   ` DJ Delorie
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2014-10-16  8:06 UTC (permalink / raw)
  To: DJ Delorie; +Cc: GCC Patches

On Thu, Oct 16, 2014 at 12:07 AM, DJ Delorie <dj@redhat.com> wrote:
>
> In the event that pointer sizes aren't powers of two, choose a more
> suitable alignment than (unsigned)(-1), which results in HUGE file
> sizes.  Ok?

Ok.

Thanks,
Richard.

> Index: gcc/lto/lto-object.c
> ===================================================================
> --- gcc/lto/lto-object.c        (revision 216287)
> +++ gcc/lto/lto-object.c        (working copy)
> @@ -335,13 +335,13 @@ lto_obj_begin_section (const char *name)
>    lo = (struct lto_simple_object *) current_out_file;
>    gcc_assert (lo != NULL
>               && lo->sobj_r == NULL
>               && 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)
>      {
>        if (err == 0)
>         fatal_error ("%s", errmsg);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [lto] don't assume pointer size
  2014-10-16  8:06 ` Richard Biener
@ 2014-10-16 21:16   ` DJ Delorie
  0 siblings, 0 replies; 3+ messages in thread
From: DJ Delorie @ 2014-10-16 21:16 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches


> > In the event that pointer sizes aren't powers of two, choose a more
> > suitable alignment than (unsigned)(-1), which results in HUGE file
> > sizes.  Ok?
> 
> Ok.

Thanks!  Committed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-16 21:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-15 22:16 [lto] don't assume pointer size DJ Delorie
2014-10-16  8:06 ` Richard Biener
2014-10-16 21:16   ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).