This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/53049] expand/TER unappropriate moving unspec volatile
- From: "gjl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 19 Apr 2012 19:31:12 +0000
- Subject: [Bug middle-end/53049] expand/TER unappropriate moving unspec volatile
- Auto-submitted: auto-generated
- References: <bug-53049-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53049
--- Comment #4 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-04-19 19:31:12 UTC ---
In tree-ssa-ter.c:is_replaceable_p() there is:
/* Leave any stmt with volatile operands alone as well. */
if (gimple_has_volatile_ops (stmt))
return false;
and in tree-ssa-ter.c:find_replaceable_in_bb():
/* Mark expression as replaceable unless stmt is volatile, or the
def variable has the same root variable as something in the
substitution list, or the def and use span a call such that
we'll expand lifetimes across a call. */
if (gimple_has_volatile_ops (stmt) || same_root_var
So it leaves volatiles alone -- at least that's what the comments indicate and
why there are tests for has_volatile at all.
If you drag A over B, you can just as well say that B is dragged over A.
This means that no volatile must be crossed as a statement is moved around.
Otherwise, a programm will never be able to state "There is something going on
that is important, but cannot be expressed".
C has no notion of execution time at all, but everyone knows that execution
time in /any/ program is crucial...
Is there a way in the backend to interfere with that malicous transforms?
A builtin is treated as CALL at this level, and calls are skipped to. So it's
all in a mess...