This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/77879] [7 Regression] mpd gets miscompiled since r235622


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77879

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 39763
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39763&action=edit
patch

<bb 24>:
_73 = MEM[(long unsigned int *)&home + 8B];
_74 = MEM[(char * *)&home];
D.32906 = PathTraitsFS::Build (_74, _73, ".config", 7); [return slot
optimization]

<bb 25>:
MEM[(struct _Alloc_hider *)&fallback]._M_p = &MEM[(struct basic_string
*)&fallback].D.17830._M_local_buf;
_76 = MEM[(char * *)&D.32906];
if (&D.32906.D.17830._M_local_buf == _76)
  goto <bb 26>;
else
  goto <bb 27>;

this is the condition that is optimized.  _76 points to nonlocal/escaped. 
Looks like a PTA bug, mishandled RSO in some way.  Ah, RSO handling is missing
from
pure/const fn handling.

Can you try if the attached fixes the issue?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]