public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/39323]  New: MAX_OFILE_ALIGNMENT in elfos.h is too big
@ 2009-02-27 23:40 hjl dot tools at gmail dot com
  2009-02-27 23:43 ` [Bug target/39323] " hjl dot tools at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-27 23:40 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2009-04-28  9:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-27 23:40 [Bug target/39323] New: MAX_OFILE_ALIGNMENT in elfos.h is too big hjl dot tools at gmail dot com
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

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).