On Fri, 2020-06-05 at 09:57 -0300, Alexandre Oliva wrote: > The testcase for PR51447, on x86_64, uses rbx as a global register > variable for the global PTR variable. > > A runtime system might legitimately hold in rbx a value expected to be > preserved across the call to main, but its use as a global register > variable stops main from preserving it. > > We've observed failures of this test on x86_64-wrs-vxworks7r2, because > of this problem, and this patch fixes them. I've also tested it on > x86_64-linux-gnu, -m64 and -m32. Ok to install? > > Since main is not supposed to be callable, I suppose we might instead > prevent global register variables from affecting the registers saved or > restored by main, but I don't have a patch for that. I could give it a > shot, if there's consensus that that would be a better fix. I'm not sure special casing this is necessarily worth the effort.
> > > for gcc/testsuite/ChangeLog > > PR rtl-optimization/51447 > * gcc.c-torture/execute/pr51447.c (main): Preserve call-saved > register. OK jeff >