This is the mail archive of the
mailing list for the GCC project.
Re: volatile access optimization (C++ / x86_64)
- From: DJ Delorie <dj at redhat dot com>
- To: NightStrike <nightstrike at gmail dot com>, Paul_Koning at dell dot com
- Cc: matt at godbolt dot org, gcc at gcc dot gnu dot org
- Date: Mon, 5 Jan 2015 13:24:49 -0500
- Subject: Re: volatile access optimization (C++ / x86_64)
- Authentication-results: sourceware.org; auth=none
- References: <CAFWXXN3quEdSnaoWuPcQn2k-F99Yaw+6=NqgFgcu9ABpv5ZD3Q at mail dot gmail dot com> <xnvbkldsgz dot fsf at greed dot delorie dot com> <CAF1jjLstqa0XxDP-5JDYmi0wNas-bHMTyR6nVt8=SYdMMqxYwg at mail dot gmail dot com>
> What is involved with the auditing?
Each pattern that (directly or indirectly) uses general_operand,
memory_operand, or nonimmediate_operand needs to be checked to see if
it's volatile-safe. If so, you need to change the predicate to
something that explicitly accepts volatiles.
There's been talk about adding direct support for a "volatile-clean"
flag that avoids this for targets where you know it's correct, which
bypasses the volatile check in those functions, but it hasn't happened