Re: Generated assembly code for returning std::optional<uint32_t>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes, it is. Thanks.

On Thu, Oct 28, 2021 at 5:55 PM Jonathan Wakely <jwakely.gcc@xxxxxxxxx>
wrote:

> On Thu, 28 Oct 2021 at 08:11, ☂Josh Chia (謝任中) via Gcc-help
> <gcc-help@xxxxxxxxxxx> wrote:
> >
> > Under -O3 -std=c++17, the assembly code generated by gcc 11.2 for some
> > std::optional C++ code seems less optimal than I expect; it is writing
> the
> > content of optional<uint64_t> return values to both the stack and to the
> > RAX register. What am I missing? I was under the impression that return
> > values are put in RAX if they can fit. Why does gcc have to write the
> > return value to both the stack and RAX instead of just one of them? Can
> the
> > writing to the stack be avoided?
>
> Is this https://gcc.gnu.org/PR101326 ?
>




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux