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
* [Bug target/39323] MAX_OFILE_ALIGNMENT in elfos.h is too big
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 ` hjl dot tools at gmail dot com
2009-02-28 0:12 ` [Bug c/39323] " hjl dot tools at gmail dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-27 23:43 UTC (permalink / raw)
To: gcc-bugs
--
hjl dot tools at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39323
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/39323] MAX_OFILE_ALIGNMENT in elfos.h is too big
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 ` hjl dot tools at gmail dot com
2009-02-28 20:01 ` hjl dot tools at gmail dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-28 0:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from hjl dot tools at gmail dot com 2009-02-28 00:12 -------
Shouldn't handle_aligned_attribute check alignment overflow?
--
hjl dot tools at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|target |c
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39323
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/39323] MAX_OFILE_ALIGNMENT in elfos.h is too big
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
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-28 20:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from hjl dot tools at gmail dot com 2009-02-28 20:01 -------
A patch is posted at
http://gcc.gnu.org/ml/gcc-patches/2009-02/msg01274.html
--
hjl dot tools at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2009-
| |02/msg01274.html
Target Milestone|4.4.0 |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39323
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/39323] MAX_OFILE_ALIGNMENT in elfos.h is too big
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
` (2 preceding siblings ...)
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
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hjl at gcc dot gnu dot org @ 2009-03-07 16:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from hjl at gcc dot gnu dot org 2009-03-07 16:32 -------
Subject: Bug 39323
Author: hjl
Date: Sat Mar 7 16:32:34 2009
New Revision: 144701
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144701
Log:
gcc/
2009-03-07 H.J. Lu <hongjiu.lu@intel.com>
PR c/39323
* c-common.c (handle_aligned_attribute): Properly check alignment
overflow. Use (1U << i) instead of (1 << i).
* emit-rtl.c (get_mem_align_offset): Use "unsigned int" for
align.
* expr.h (get_mem_align_offset): Updated.
* tree.h (tree_decl_common): Change align to "unsigned int" and
move it before pointer_alias_set.
gcc/ada/
2009-03-07 H.J. Lu <hongjiu.lu@intel.com>
PR c/39323
* gcc-interface/utils.c (create_field_decl): Use "unsigned int"
on bit_align.
gcc/testsuite/
2009-03-07 H.J. Lu <hongjiu.lu@intel.com>
PR c/39323
* gcc.dg/pr39323-1.c: New.
* gcc.dg/pr39323-2.c: Likewise.
* gcc.dg/pr39323-3.c: Likewise.
Added:
branches/stack/gcc/ada/ChangeLog.stackalign
branches/stack/gcc/testsuite/gcc.dg/pr39323-1.c
branches/stack/gcc/testsuite/gcc.dg/pr39323-2.c
branches/stack/gcc/testsuite/gcc.dg/pr39323-3.c
Modified:
branches/stack/gcc/ChangeLog.stackalign
branches/stack/gcc/ada/gcc-interface/utils.c
branches/stack/gcc/c-common.c
branches/stack/gcc/emit-rtl.c
branches/stack/gcc/expr.h
branches/stack/gcc/testsuite/ChangeLog.stackalign
branches/stack/gcc/tree.h
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39323
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/39323] MAX_OFILE_ALIGNMENT in elfos.h is too big
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
` (3 preceding siblings ...)
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
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hjl at gcc dot gnu dot org @ 2009-03-27 22:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from hjl at gcc dot gnu dot org 2009-03-27 22:33 -------
Subject: Bug 39323
Author: hjl
Date: Fri Mar 27 22:33:16 2009
New Revision: 145136
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145136
Log:
gcc/
2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
PR c/39323
* c-common.c (handle_aligned_attribute): Properly check alignment
overflow. Use (1U << i) instead of (1 << i).
* emit-rtl.c (get_mem_align_offset): Use "unsigned int" for
align.
* expr.h (get_mem_align_offset): Updated.
* tree.h (tree_decl_common): Change align to "unsigned int" and
move it before pointer_alias_set.
gcc/ada/
2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
PR c/39323
* gcc-interface/utils.c (create_field_decl): Use "unsigned int"
on bit_align.
gcc/testsuite/
2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
PR c/39323
* gcc.dg/pr39323-1.c: New.
* gcc.dg/pr39323-2.c: Likewise.
* gcc.dg/pr39323-3.c: Likewise.
Added:
trunk/gcc/testsuite/gcc.dg/pr39323-1.c
trunk/gcc/testsuite/gcc.dg/pr39323-2.c
trunk/gcc/testsuite/gcc.dg/pr39323-3.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ada/ChangeLog
trunk/gcc/ada/gcc-interface/utils.c
trunk/gcc/c-common.c
trunk/gcc/emit-rtl.c
trunk/gcc/expr.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree.h
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39323
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/39323] MAX_OFILE_ALIGNMENT in elfos.h is too big
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
` (4 preceding siblings ...)
2009-03-27 22:34 ` hjl at gcc dot gnu dot org
@ 2009-04-02 16:42 ` janis at gcc dot gnu dot org
2009-04-16 18:34 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: janis at gcc dot gnu dot org @ 2009-04-02 16:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from janis at gcc dot gnu dot org 2009-04-02 16:41 -------
The alignment checks in tests pr39323-2.c and pr39323-3.c fail on
powerpc*-linux, where the value in .align is log2 of the alignment, not the
alignment itself. For an alignment of (1<<28) we get ".align 28", for an
alignment of 32 we get ".align 5". That might be true of some other ELF
targets as well.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39323
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/39323] MAX_OFILE_ALIGNMENT in elfos.h is too big
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
` (5 preceding siblings ...)
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
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-16 18:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2009-04-16 18:34 -------
Stop setting the target milestone unless it is a regression.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.5.0 |---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39323
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/39323] MAX_OFILE_ALIGNMENT in elfos.h is too big
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
` (6 preceding siblings ...)
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
8 siblings, 0 replies; 10+ messages in thread
From: uros at gcc dot gnu dot org @ 2009-04-28 9:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from uros at gcc dot gnu dot org 2009-04-28 09:48 -------
Subject: Bug 39323
Author: uros
Date: Tue Apr 28 09:48:04 2009
New Revision: 146881
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146881
Log:
PR c/39323
* config/alpha/elf.h (MAX_OFILE_ALIGNMENT): Sync with elfos.h
testsuite/ChangeLog:
PR c/39323
* gcc.dg/pr39323-2.c: Also scan for alignment in log2 format.
* gcc.dg/pr39323-3.c: Ditto.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/alpha/elf.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/pr39323-2.c
trunk/gcc/testsuite/gcc.dg/pr39323-3.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39323
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/39323] MAX_OFILE_ALIGNMENT in elfos.h is too big
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
` (7 preceding siblings ...)
2009-04-28 9:48 ` uros at gcc dot gnu dot org
@ 2009-04-28 9:49 ` ubizjak at gmail dot com
8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2009-04-28 9:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from ubizjak at gmail dot com 2009-04-28 09:49 -------
(In reply to comment #5)
> The alignment checks in tests pr39323-2.c and pr39323-3.c fail on
> powerpc*-linux, where the value in .align is log2 of the alignment, not the
> alignment itself. For an alignment of (1<<28) we get ".align 28", for an
> alignment of 32 we get ".align 5". That might be true of some other ELF
> targets as well.
This is fixed in rev 146881.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
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).