https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102216
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot
gnu.org
Ever confirmed|0 |1
Last reconfirmed| |2021-09-06
CC| |pinskia at gcc dot gnu.org
Keywords| |diagnostic,
| |missed-optimization
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The problem is dead code:
language_names_p_9 = &MEM <const char *> [(void *)_4 + 24B];
MEM[(const char * *)_4 + 24B] = "";
MEM[(const char * *)_4 + 32B] = "";
MEM[(const char * *)_4 + 40B] = 0B;
_2 = _4 + 40;
D.50907._M_comp = compare_cstrings;
__comp = D.50907;
if (_2 != language_names_p_9)
goto <bb 3>; [53.47%]
else
goto <bb 12>; [46.53%]
<bb 3> [local count: 574129759]:
_15 = _2 - language_names_p_9;
_16 = _15 /[ex] 8;
...
_22 = _2 - language_names_p_9;
if (_22 > 128)
goto <bb 4>; [50.00%]
else
goto <bb 10>; [50.00%]
<bb 4> [local count: 287064879]:
_23 = &MEM <const char *> [(void *)_4 + 152B];
std::__insertion_sort<const char**, __gnu_cxx::__ops::_Iter_comp_iter<bool
(*)(const char*, const char*)> > (language_names_p_9, _23, __comp);
__comp_24 = MEM[(struct _Iter_comp_iter *)&__comp];
goto <bb 9>; [100.00%]
That is _22 (and _15) should be 16.
I just fixed a similar issue today (but the patch did not fix this case).
I will look into fixing this one tomorrow.