public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl dot tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/39323]  New: MAX_OFILE_ALIGNMENT in elfos.h is too big
Date: Fri, 27 Feb 2009 23:40:00 -0000	[thread overview]
Message-ID: <bug-39323-682@http.gcc.gnu.org/bugzilla/> (raw)

struct tree_decl_common has

unsigned int align : 24;

And the maximum alignment we support is 1 << 23 bits (1 << 20 bytes). However,
config/elfos.h has

/* The biggest alignment supported by ELF in bits. 32-bit ELF 
   supports section alignment up to (0x80000000 * 8), while 
   64-bit ELF supports (0x8000000000000000 * 8). If this macro 
   is not defined, the default is the largest alignment supported 
   by 32-bit ELF and representable on a 32-bit host. Use this
   macro to limit the alignment which can be specified using
   the `__attribute__ ((aligned (N)))' construct.  */
#ifndef MAX_OFILE_ALIGNMENT
#define MAX_OFILE_ALIGNMENT (((unsigned int) 1 << 28) * 8)
#endif

If we ask for alignment greater than 1 << 20 bytes, we won't
get any warnings:

[hjl@gnu-17 gcc]$  cat x.c    
int foo __attribute__ ((aligned(1 << 21))) =  20;
int bar __attribute__ ((aligned(1 << 20))) =  20;
[hjl@gnu-17 gcc]$ ./xgcc -B./ -S x.i 
[hjl@gnu-17 gcc]$ cat x.s
        .file   "x.i"
.globl foo
        .data
        .type   foo, @object
        .size   foo, 4
foo:
        .long   20
.globl bar
        .align 1048576
        .type   bar, @object
        .size   bar, 4
bar:
        .long   20


-- 
           Summary: MAX_OFILE_ALIGNMENT in elfos.h is too big
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39323


             reply	other threads:[~2009-02-27 23:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-27 23:40 hjl dot tools at gmail dot com [this message]
2009-02-27 23:43 ` [Bug target/39323] " hjl dot tools at gmail dot com
2009-02-28  0:12 ` [Bug c/39323] " hjl dot tools at gmail dot com
2009-02-28 20:01 ` hjl dot tools at gmail dot com
2009-03-07 16:33 ` hjl at gcc dot gnu dot org
2009-03-27 22:34 ` hjl at gcc dot gnu dot org
2009-04-02 16:42 ` [Bug target/39323] " janis at gcc dot gnu dot org
2009-04-16 18:34 ` pinskia at gcc dot gnu dot org
2009-04-28  9:48 ` uros at gcc dot gnu dot org
2009-04-28  9:49 ` ubizjak at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-39323-682@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).