This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int
- From: "raj.khem at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 9 Jun 2011 06:47:30 +0000
- Subject: [Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int
- Auto-submitted: auto-generated
- References: <bug-45819-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819
Khem Raj <raj.khem at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |raj.khem at gmail dot com
--- Comment #9 from Khem Raj <raj.khem at gmail dot com> 2011-06-09 06:47:01 UTC ---
here is another testcase which generates loadbytes with gcc 4.6 but works as
expected with gcc 4.5 on arm. gcc are latest from respective branches. and it
fails irrespective of having -fstrict-volatile-bitfields or not.
struct ehci_regs {
char x;
unsigned int port_status[0];
} __attribute__ ((packed));
//} __attribute__ ((packed,aligned(__alignof__(int))));
struct ehci_hcd{
struct ehci_regs *regs;
};
int ehci_hub_control (
struct ehci_hcd *ehci,
int wIndex
) {
unsigned int *status_reg = &ehci->regs->port_status[wIndex];
return *(volatile unsigned int *)status_reg;
}