[Bug tree-optimization/54494] New: Missing store to volatile
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Sep 5 17:47:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54494
Bug #: 54494
Summary: Missing store to volatile
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: pinskia@gcc.gnu.org
Consider:
extern const unsigned long base;
static inline void wreg(unsigned char val, unsigned long addr)
{
*((volatile unsigned char *) (base + addr)) = val;
}
void wreg_twice(void)
{
wreg(0, 42);
wreg(0, 42);
}
---- CUT ---
At -O2 the second store to the volatile char is removed by the strlen pass.
More information about the Gcc-bugs
mailing list