https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115014
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Martin Doucha from comment #2) > > This is certainly not wanted in the most common case where the flat memory > assumption is correct. But it should be used for compiling embedded binaries > with -ffreestanding argument. I think most embedded targets use a flat memory system even on x86_64. I really think you are barking up the wrong tree on getting this implemented in GCC (or even LLVM) because of the complexity of tracking the memory. It is not just about adding ds for ebp accesses. Maybe the easiest fix is to use -fno-omit-frame-pointer to force always the use of EBP as stack accesses only.