This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/50078] New: [4.6.1+ SVN 2011-08-13] ARM wrong code: volatile accesses optimized out
- From: "khc at pm dot waw.pl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 13 Aug 2011 23:02:33 +0000
- Subject: [Bug c/50078] New: [4.6.1+ SVN 2011-08-13] ARM wrong code: volatile accesses optimized out
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50078
Bug #: 50078
Summary: [4.6.1+ SVN 2011-08-13] ARM wrong code: volatile
accesses optimized out
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: khc@pm.waw.pl
I think armeb-pc-linux-gnueabi-gcc 4.6.2pre 20110813 (cross-compiled on x86-64)
is a bit too optimistic with -O2:
unsigned var[2];
void test(int arg)
{
unsigned v = *(volatile unsigned *)(&var[arg]);
*(volatile unsigned *)(&var[arg]) = v;
}
produces:
00000000 <test>:
0: e12fff1e bx lr