On May 3, 2017 6:22:14 PM GMT+02:00, Jakub Jelinek <ja...@redhat.com> wrote: >On Wed, May 03, 2017 at 06:18:08PM +0200, Jan Hubicka wrote: >> Hi, >> my change to sreals makes GCC to be miscompiled with GCC 4.1 and -O0. > This is >> related to fact that using sreal implies a non-trivial constructor >and thus >> ggc_cleared_alloc is no longer standard compliant. I however do not >quite understand >> why GCC 4.1 manages to misoptimize this code but I have checked that >this helps >> to fix the issue and hopefully will re-start our periodic testers. > >Is store-merging pass able to optimize that back into reasonable code >(sure, not into ggc_cleared_alloc)?
Whether it is or not, the previous code was buggy. The zeroing does not prevail until after the object construction begins (not sure whether for PODs this would be different). Richard. > Jakub