Re: [PATCH] SH FDPIC backend support

2015-10-05 Thread Oleg Endo
On Sun, 2015-10-04 at 22:16 -0400, Rich Felker wrote: > This is FDPIC-specific. Because there is fundamentally no way for a > function to find its own GOT (it has one GOT for each process using > the code containing the function), its GOT address has to be a > (hidden) argument to the function whic

Re: [PATCH] SH FDPIC backend support

2015-10-05 Thread Kaz Kojima
Oleg Endo wrote: >> So apparently the strange behavior I observed is intended. Presumably >> there is some mechanism to ensure that these functions are always >> static-linked? But I don't see it. The libgcc spec I see is: >> >> *libgcc: >> %{static|static-libgcc:-lgcc >> -lgcc_eh}%{!static:%{!st

Re: [PATCH] SH FDPIC backend support

2015-10-04 Thread Rich Felker
On Sun, Oct 04, 2015 at 02:10:42PM +0900, Oleg Endo wrote: > On Sat, 2015-10-03 at 18:34 -0400, Rich Felker wrote: > > > > > > I found and fixed the problem, but I have a new concern: calls to the > > > new shift instructions are using the following address forms: > > > > > > -mno-fdpic -fPIC: >

Re: [PATCH] SH FDPIC backend support

2015-10-03 Thread Oleg Endo
On Sat, 2015-10-03 at 18:34 -0400, Rich Felker wrote: > > > > I found and fixed the problem, but I have a new concern: calls to the > > new shift instructions are using the following address forms: > > > > -mno-fdpic -fPIC: > > .long __ashlsi3_r0@GOTOFF > > > > -mfdpic: > > .long __a

Re: [PATCH] SH FDPIC backend support

2015-10-03 Thread Rich Felker
On Fri, Oct 02, 2015 at 11:18:32AM -0400, Rich Felker wrote: > > > +#ifdef __FDPIC__ > > > +#define udiv_qrnnd(q, r, n1, n0, d) \ > > > + do { > > > \ > > > +extern UWtype __udiv_qrnnd_16 (UWtype, UWtype)

Re: [PATCH] SH FDPIC backend support

2015-10-03 Thread Rich Felker
On Sat, Oct 03, 2015 at 03:12:16PM -0400, Rich Felker wrote: > On Thu, Oct 01, 2015 at 09:30:17PM -0400, Rich Felker wrote: > > But trying the patch on vanilla GCC trunk without my usual J2 target > > setup revealed some additional issues I need to address. I'm getting > > ICE in the code that gene

Re: [PATCH] SH FDPIC backend support

2015-10-03 Thread Rich Felker
On Thu, Oct 01, 2015 at 09:30:17PM -0400, Rich Felker wrote: > But trying the patch on vanilla GCC trunk without my usual J2 target > setup revealed some additional issues I need to address. I'm getting > ICE in the code that generates the libgcc bitshift calls, which > weren't used on J2. This is

Re: [PATCH] SH FDPIC backend support

2015-10-03 Thread Rich Felker
On Sat, Oct 03, 2015 at 05:17:53PM +0900, Oleg Endo wrote: > On Sat, 2015-10-03 at 00:50 -0400, Rich Felker wrote: > > > I have -mfdpic in the self-specs when FDPIC_DEFAULT is defined, so I > > think only the positive form is needed. > > Having positive and negative forms for options makes sense

Re: [PATCH] SH FDPIC backend support

2015-10-03 Thread Oleg Endo
On Sat, 2015-10-03 at 00:50 -0400, Rich Felker wrote: > I have -mfdpic in the self-specs when FDPIC_DEFAULT is defined, so I > think only the positive form is needed. Having positive and negative forms for options makes sense. It usually costs nothing because anyway the compiler internally supp

Re: [PATCH] SH FDPIC backend support

2015-10-02 Thread Rich Felker
On Sat, Oct 03, 2015 at 06:57:56AM +0900, Kaz Kojima wrote: > Rich Felker wrote: > > I worked around it and opened an issue for it: > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67812 > > > > But trying the patch on vanilla GCC trunk without my usual J2 target > > setup revealed some addi

Re: [PATCH] SH FDPIC backend support

2015-10-02 Thread Kaz Kojima
Rich Felker wrote: > I worked around it and opened an issue for it: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67812 > > But trying the patch on vanilla GCC trunk without my usual J2 target > setup revealed some additional issues I need to address. I'm getting > ICE in the code that genera

Re: [PATCH] SH FDPIC backend support

2015-10-02 Thread Oleg Endo
On Fri, 2015-10-02 at 11:18 -0400, Rich Felker wrote: > Thanks! This is very helpful. gcc style has changed a lot since the > old patch was submitted so I think it makes sense to update it to > match current practices rather than just making it work. I'll try to > focus on any functional problems

Re: [PATCH] SH FDPIC backend support

2015-10-02 Thread Rich Felker
On Fri, Oct 02, 2015 at 10:51:03PM +0900, Oleg Endo wrote: > On Thu, 2015-10-01 at 21:30 -0400, Rich Felker wrote: > > > If you have any other general comments on the patch in the mean time > > I'd be happy to hear them. > > Below are some comments. Might be a bit unstructured, I was hopping > t

Re: [PATCH] SH FDPIC backend support

2015-10-02 Thread Oleg Endo
On Thu, 2015-10-01 at 21:30 -0400, Rich Felker wrote: > If you have any other general comments on the patch in the mean time > I'd be happy to hear them. Below are some comments. Might be a bit unstructured, I was hopping through the patch file. Sorry about that. > +function_symbol (rtx target

Re: [PATCH] SH FDPIC backend support

2015-10-01 Thread Rich Felker
On Thu, Oct 01, 2015 at 07:39:10PM -0400, Rich Felker wrote: > On Fri, Oct 02, 2015 at 07:36:27AM +0900, Oleg Endo wrote: > > On Thu, 2015-10-01 at 17:35 -0400, Rich Felker wrote: > > > This is a forward-port of the abandoned SH FDPIC patch from 2010: > > > > > > https://gcc.gnu.org/ml/gcc-patches

Re: [PATCH] SH FDPIC backend support

2015-10-01 Thread Rich Felker
On Fri, Oct 02, 2015 at 07:36:27AM +0900, Oleg Endo wrote: > On Thu, 2015-10-01 at 17:35 -0400, Rich Felker wrote: > > This is a forward-port of the abandoned SH FDPIC patch from 2010: > > > > https://gcc.gnu.org/ml/gcc-patches/2010-08/msg01536.html > > > > I'm submitting it at this point for ini

Re: [PATCH] SH FDPIC backend support

2015-10-01 Thread Oleg Endo
On Thu, 2015-10-01 at 17:35 -0400, Rich Felker wrote: > This is a forward-port of the abandoned SH FDPIC patch from 2010: > > https://gcc.gnu.org/ml/gcc-patches/2010-08/msg01536.html > > I'm submitting it at this point for initial review, not to be applied > right away; I would not be surprised i

[PATCH] SH FDPIC backend support

2015-10-01 Thread Rich Felker
This is a forward-port of the abandoned SH FDPIC patch from 2010: https://gcc.gnu.org/ml/gcc-patches/2010-08/msg01536.html I'm submitting it at this point for initial review, not to be applied right away; I would not be surprised if some changes are needed. It applies on top of gcc 5.2.0 with the