https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98834
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2021-01-26
Keywords| |needs-bisection, wrong-code
CC| |jamborm at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Ever confirmed|0 |1
Component|tree-optimization |ipa
Target Milestone|--- |10.3
Priority|P3 |P2
Status|UNCONFIRMED |NEW
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed, the __builtin_unreachable is introduced by inlining:
Considering _S_multiplies.isra/23 with 12 size
to be inlined into int main()/13 in t.C:54
Estimated badness is -inf, frequency 1.00.
Badness calculation for int main()/13 -> _S_multiplies.isra/23
size growth -2, time 2.000000 unspec 10.000000 IPA hints: declared_inline
big_speedup
-inf: Growth -2 <= 0
Adjusted by hints -inf
Accounting size:2.00, time:2.00 on predicate exec:(true)
Introduced new external node (void __builtin_unreachable()/24).
Processing frequency _S_multiplies.isra/23
Called by int main()/13 that is executed once
Accounting size:-4.00, time:-13.00 on predicate exec:(true)
t.C:54:62: optimized: Inlined _S_multiplies.isra/23 into int main()/13 which
now has time 8.000000 and size 9, net change of -14.
which points to IPA SRA. VRP then simplifies __builtin_constant_p seen as
_12 = __builtin_constant_p (__xx_11);
if (_12 != 0)
goto <bb 4>; [100.00%]
else
goto <bb 3>; [0.00%]
<bb 3> [count: 0]:
__builtin_unreachable ();
<bb 4> [local count: 1073741824]:
MEM <int> [(struct _Tuple *)&D.2557] = 0;
and uses conservatively false but that runs into __builtin_unreachable () ...
The IPA inline transform ends us with
_12 = __builtin_constant_p (__xx_11);
if (_12 != 0)
goto <bb 4>; [100.00%]
else
goto <bb 3>; [0.00%]
<bb 3> [count: 0]:
_13 = _16(D);
__builtin_unreachable ();
<bb 4> [local count: 1073741824]:
# SR.30_15 = PHI <__y_10(2)>
which eventually shows the reason (the unused argument?)