Mike Stump <mikest...@comcast.net> writes: > On Aug 4, 2013, at 8:14 AM, Chung-Lin Tang <clt...@codesourcery.com> wrote: >> On 13/7/15 1:43 AM, Diego Novillo wrote: >>> Could you please repost the patch with its description? This thread >>> is sufficiently old and noisy that I'm not even sure what the patch >>> does nor why. >> >> Taking the same example in my first post: > >> Under -fPIC, the code in rtlanal.c:nonzero_address_p() does not properly >> recognize the "PIC-reg + <constant>" form of load as a weak symbol; it >> returns 'true' immediately after seeing the pic-reg indexing, and does >> not test the wrapped symbol for DECL_WEAK. > > So, I can't help but think that others would say that looking into an > unspec is by nature, the wrong way to do it, unless that code is in the > port.
Yeah. I didn't want to reply again for fear of prolonging the thread even more, but that's why I'd suggested removing: /* Handle PIC references. */ if (XEXP (x, 0) == pic_offset_table_rtx && CONSTANT_P (XEXP (x, 1))) return true; altogether and using targetm.delegitimize_address instead. I think that's our current interface for dealing with this kind of thing. Thanks, Richard