https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105134
--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to piliu from comment #10) > (In reply to Andrew Pinski from comment #7) > > I am trying to understand this. Is it ok to use the SSE registers inside > > purgatory or not? > > > > SSE can speed up the program, and if possible it is suggested to turn on. > > Any guideline about when it can not be used? Yes if you are inside the kernel/bootloader SSE might not be turned on. So my question here. Normal parts of the kernel cannot use SSE instructions either which is why there is an option to turn it off. Maybe it is best to ask the kexec-tools folks if SSE can be used here. I suspect you cannot. GCC was not emitting SSE instructions before and now is at -O2 which is why -fno-tree-vectorize works as it turns off emitting of SSE instructions again. There is nothing wrong with what GCC emits for sha256_starts for the options kexec-tools supplied even, just it is supplying the wrong set of options in the first place. For user code SSE code is always fine as the compiler and glibc has been using SSE code early on. As I said it if it is a bootloader/kernel, then you have to ask is SSE turned on or not and do we save/restore the registers correctly, etc.