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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization, ra
             Target|                            |x86_64-*-*, i?86-*-*
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-02
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Well, if you want to read %rbx as it is at the point of the asm (you don't
initialize "rbx") then simply read from it without any input or input
constraint.
Or do not use an asm at tall but just 'return rbx;'?

As of why we still push/pop %rbx, no idea.  That is, confirmed with

#include <stdint.h>

uint64_t read_rbx(void) {
  register uint64_t rbx asm ("rbx");
  return rbx;
}

Reply via email to