http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50571
Bug #: 50571
Summary: [4.6/4.7 Regression] Undesirable folding in "m"
constrained asm operands
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: [email protected]
ReportedBy: [email protected]
static const int var[4] = { 1, 2, 3, 4 };
void
foo (void)
{
__asm volatile ("" : : "m" (*(int *) var));
}
warns at -O2:
warning: use of memory input without lvalue in asm operand 0 is deprecated
[enabled by default]
although the source has there addressable memory. The problem is that
gimple-fold transformed this into "m" (1), which is deprecated.