This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/81741] Misoptimisation : replacing a constant field read access by a function call
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 08 Aug 2017 07:32:50 +0000
- Subject: [Bug tree-optimization/81741] Misoptimisation : replacing a constant field read access by a function call
- Auto-submitted: auto-generated
- References: <bug-81741-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81741
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-08-08
CC| |rguenth at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm quite sure it is because of propagating a conditional equivalence.
-fno-tree-dominator-opts fixes this (it's the only pass doing this kind of
propagation IIRC).
<bb 2> [100.00%]:
_1 = s_5(D)->ptr;
_2 = strlen (_1);
_3 = s_5(D)->size;
if (_2 != _3)
goto <bb 3>; [0.04%]
else
goto <bb 4>; [99.96%]
<bb 3> [0.04%]:
__builtin_unreachable ();
<bb 4> [99.96%]:
_6 = (int) _3;
return _6;
here DOM decides well, on the else path _2 == _3 so let's propagate!
IMHO we _never_ should propagate (non-constant) conditional equivalences.