When PIC register is pseudo there is nothing special about it's value that setjmp can hurt. So if the pseudo register lives across setjmp_receiver RA should care about correct allocation (in case it is not saved/restored, it should go on stack). gcc.dg tests and specs I've tested behave like this.
The initial problem comes from non-local goto as it tries to emit pseudo PIC register after reload. On Fri, Oct 31, 2014 at 11:14 PM, Jeff Law <l...@redhat.com> wrote: > On 10/17/14 08:08, Evgeny Stupachenko wrote: >> >> Hi, >> >> The patch fixes 1st fail in darwin bootstarp. >> When PIC register is pseudo we don't need to init it after setjmp or >> non local goto. >> >> Is it ok? >> >> ChangeLog: >> >> 2014-10-17 Evgeny Stupachenko <evstu...@gmail.com> >> >> PR target/63534 >> * config/i386/i386.c (builtin_setjmp_receiver): Delete. >> (nonlocal_goto_receiver): Ditto. > > > Why do you think they're not needed? The builtin setjmp/longjmp > implementation do not behave like what you're used to in the C library. > Specifically, they do not save/restore register state beyond SP, FP and > possibly ARGP. > > So let's take one step back -- what precisely about these patterns was > causing a problem? My initial inclination is that we must set the PIC > register here in the same manner as it's set in the prologue. > > > > Jeff