On 03/04/2014 10:12 PM, Yury Gribov wrote: >>> Asms without outputs are automatically volatile. So there ought be zero >>> change >>> with and without the explicit use of the __volatile__ keyword. >> >> That’s what the documentation says but it wasn’t actually true >> as of a couple of releases ago, as I recall. > > Looks like 2005: > > $ git annotate gcc/c/c-typeck.c > ... > 89552023 ( bonzini 2005-10-05 12:17:16 +0000 9073) /* asm > statements without outputs, including simple ones, are treated > 89552023 ( bonzini 2005-10-05 12:17:16 +0000 9074) as > volatile. */ > 89552023 ( bonzini 2005-10-05 12:17:16 +0000 9075) > ASM_INPUT_P (args) = simple; > 89552023 ( bonzini 2005-10-05 12:17:16 +0000 9076) > ASM_VOLATILE_P (args) = (noutputs == 0);
Yep, that's the one. So, more than "a couple" of releases: gcc 4.2 and later. r~