public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/39283] New: volatile data types ignore __attribute__ ((__aligned ...))
@ 2009-02-23 22:40 hp at gcc dot gnu dot org
2009-02-23 22:44 ` [Bug c/39283] " pinskia at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: hp at gcc dot gnu dot org @ 2009-02-23 22:40 UTC (permalink / raw)
To: gcc-bugs
Maybe there are two bugs here.
#include <stdio.h>
typedef int ix __attribute__ ((__aligned__ (16)));
typedef volatile int vx __attribute__ ((__aligned__ (16)));
ix ix1 = __alignof__ (ix);
ix ix2 = __alignof__ (ix1);
vx vx1 = __alignof__ (vx);
vx vx2 = __alignof__ (vx1);
int main(void)
{
printf ("ix1: %d, ix2: %d, vx1: %d, vx2: %d\n",
ix1, ix2, vx1, vx2);
return ix1 == ix2 && ix1 == vx1 && ix1 == vx2 ? 0 : 1;
}
For i686-pc-linux-gnu, observe 16, 16, 4, 4 for the above program. That's by
itself surprising: the "volatile" specifier seems to nullify the attribute
specifier.
For crisv32-axis-linux-gnu it's even worse: it's 16, 16, 1, 4 at -O0, but 16,
16, 4, 4 at -O2. Bother.
--
Summary: volatile data types ignore __attribute__ ((__aligned
...))
Product: gcc
Version: 4.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hp at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: crisv32-axis-linux-gnu, i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39283
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/39283] volatile data types ignore __attribute__ ((__aligned ...))
2009-02-23 22:40 [Bug target/39283] New: volatile data types ignore __attribute__ ((__aligned ...)) hp at gcc dot gnu dot org
@ 2009-02-23 22:44 ` pinskia at gcc dot gnu dot org
2009-02-23 22:45 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-02-23 22:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2009-02-23 22:43 -------
This works correctly with the C++ front-end:
[dhcp-10-98-10-23:~] apinski% ~/local-gcc/bin/gcc t.c
[dhcp-10-98-10-23:~] apinski% ./a.out
ix1: 16, ix2: 16, vx1: 4, vx2: 4
[dhcp-10-98-10-23:~] apinski% ~/local-gcc/bin/g++ t.c
./[dhcp-10-98-10-23:~] apinski% ./a.out
ix1: 16, ix2: 16, vx1: 16, vx2: 16
Confirmed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|middle-end |c
Ever Confirmed|0 |1
Keywords| |wrong-code
Known to fail| |3.3 4.0.2 4.4.0
Last reconfirmed|0000-00-00 00:00:00 |2009-02-23 22:43:50
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39283
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/39283] volatile data types ignore __attribute__ ((__aligned ...))
2009-02-23 22:40 [Bug target/39283] New: volatile data types ignore __attribute__ ((__aligned ...)) hp at gcc dot gnu dot org
2009-02-23 22:44 ` [Bug c/39283] " pinskia at gcc dot gnu dot org
@ 2009-02-23 22:45 ` pinskia at gcc dot gnu dot org
2009-02-23 22:48 ` hp at gcc dot gnu dot org
2009-02-23 22:57 ` hp at gcc dot gnu dot org
3 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-02-23 22:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2009-02-23 22:45 -------
So the cris problem with 1 vs 4 might be a different issue but the C front-end
does something incorrectly anyways.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39283
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/39283] volatile data types ignore __attribute__ ((__aligned ...))
2009-02-23 22:40 [Bug target/39283] New: volatile data types ignore __attribute__ ((__aligned ...)) hp at gcc dot gnu dot org
2009-02-23 22:44 ` [Bug c/39283] " pinskia at gcc dot gnu dot org
2009-02-23 22:45 ` pinskia at gcc dot gnu dot org
@ 2009-02-23 22:48 ` hp at gcc dot gnu dot org
2009-02-23 22:57 ` hp at gcc dot gnu dot org
3 siblings, 0 replies; 6+ messages in thread
From: hp at gcc dot gnu dot org @ 2009-02-23 22:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from hp at gcc dot gnu dot org 2009-02-23 22:48 -------
(In reply to comment #2)
> So the cris problem with 1 vs 4 might be a different issue but the C front-end
> does something incorrectly anyways.
I was assuming it's the same basic problem, if nothing else that assumption
simplified bug-reporting. :) But sure, middle-end instead of target is then
more consistent.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39283
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/39283] volatile data types ignore __attribute__ ((__aligned ...))
2009-02-23 22:40 [Bug target/39283] New: volatile data types ignore __attribute__ ((__aligned ...)) hp at gcc dot gnu dot org
` (2 preceding siblings ...)
2009-02-23 22:48 ` hp at gcc dot gnu dot org
@ 2009-02-23 22:57 ` hp at gcc dot gnu dot org
3 siblings, 0 replies; 6+ messages in thread
From: hp at gcc dot gnu dot org @ 2009-02-23 22:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from hp at gcc dot gnu dot org 2009-02-23 22:56 -------
(In reply to comment #3)
> But sure, middle-end instead of target is then
> more consistent.
...or "c". Whatever!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39283
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <bug-39283-4@http.gcc.gnu.org/bugzilla/>]
end of thread, other threads:[~2012-05-25 6:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-23 22:40 [Bug target/39283] New: volatile data types ignore __attribute__ ((__aligned ...)) hp at gcc dot gnu dot org
2009-02-23 22:44 ` [Bug c/39283] " pinskia at gcc dot gnu dot org
2009-02-23 22:45 ` pinskia at gcc dot gnu dot org
2009-02-23 22:48 ` hp at gcc dot gnu dot org
2009-02-23 22:57 ` hp at gcc dot gnu dot org
[not found] <bug-39283-4@http.gcc.gnu.org/bugzilla/>
2012-05-25 6:40 ` hp at gcc dot gnu.org
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).