On 1/7/19 10:23 AM, Jakub Jelinek wrote: > On Sun, Dec 16, 2018 at 06:13:57PM +0200, Dimitar Dimitrov wrote: >> - /* Clobbering the STACK POINTER register is an error. */ >> + /* Clobbered STACK POINTER register is not saved/restored by GCC, >> + which is often unexpected by users. See PR52813. */ >> if (overlaps_hard_reg_set_p (regset, Pmode, STACK_POINTER_REGNUM)) >> { >> - error ("Stack Pointer register clobbered by %qs in %", regname); >> + warning (0, "Stack Pointer register clobbered by %qs in %", >> + regname); >> + warning (0, "GCC has always ignored Stack Pointer % clobbers"); > > Why do we write Stack Pointer rather than stack pointer? That is really > weird. The second warning would be a note based on the first one, i.e. > if (warning ()) note (); > and better have some -W* option to silence the warning. > Yes, thanks for this suggestion. Meanwhile I found out, that the stack clobber has only been ignored up to gcc-5 (at least with lra targets, not really sure about reload targets). From gcc-6 on, with the exception of PR arm/77904 which was a regression due to the underlying lra change, but fixed later, and back-ported to gcc-6.3.0, this works for all targets I tried so far. To me, it starts to look like a rather unique and useful feature, that I would like to keep working. Attached is an updated version if my patch, using the suggested warning option, and a note with the details. Bootstrapped on x86_64-pc-linux-gnu. Is it OK for trunk? Thanks Bernd.