Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-08-29 Thread Oleg Endo
On Wed, 2013-08-07 at 21:24 +0200, Oleg Endo wrote: On Wed, 2013-08-07 at 15:08 -0400, Michael Meissner wrote: On Tue, Aug 06, 2013 at 11:45:40PM +0200, Oleg Endo wrote: On Mon, 2013-08-05 at 13:25 -1000, Richard Henderson wrote: On 08/05/2013 12:32 PM, Oleg Endo wrote: Thanks,

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-08-29 Thread Jakub Jelinek
On Thu, Aug 29, 2013 at 08:45:33PM +0200, Oleg Endo wrote: Sorry for the delay. I've just backported the 2 patches to 4.8. Tested with 'make all-gcc' for SH and PPC cross compilers. Committed as rev 202083. Please fix the overly long lines as a follow-up. +struct insn_gen_fn +{ + typedef

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-08-29 Thread Oleg Endo
On Thu, 2013-08-29 at 20:51 +0200, Jakub Jelinek wrote: On Thu, Aug 29, 2013 at 08:45:33PM +0200, Oleg Endo wrote: Sorry for the delay. I've just backported the 2 patches to 4.8. Tested with 'make all-gcc' for SH and PPC cross compilers. Committed as rev 202083. Please fix the overly

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-08-27 Thread Stefan Kristiansson
On Tue, Aug 27, 2013 at 11:03:32AM +0200, Richard Biener wrote: On Wed, Jul 10, 2013 at 3:14 AM, Stefan Kristiansson stefan.kristians...@saunalahti.fi wrote: The (static arg) generator functions are casted to a var arg function pointer, making the assumption that the ABI for passing the

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-08-07 Thread Michael Meissner
On Tue, Aug 06, 2013 at 11:45:40PM +0200, Oleg Endo wrote: On Mon, 2013-08-05 at 13:25 -1000, Richard Henderson wrote: On 08/05/2013 12:32 PM, Oleg Endo wrote: Thanks, committed as rev 201513. 4.8 also has the same problem. The patch applies on 4.8 branch without problems and make

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-08-07 Thread Oleg Endo
On Wed, 2013-08-07 at 15:08 -0400, Michael Meissner wrote: On Tue, Aug 06, 2013 at 11:45:40PM +0200, Oleg Endo wrote: On Mon, 2013-08-05 at 13:25 -1000, Richard Henderson wrote: On 08/05/2013 12:32 PM, Oleg Endo wrote: Thanks, committed as rev 201513. 4.8 also has the same problem.

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-08-06 Thread Oleg Endo
On Mon, 2013-08-05 at 13:25 -1000, Richard Henderson wrote: On 08/05/2013 12:32 PM, Oleg Endo wrote: Thanks, committed as rev 201513. 4.8 also has the same problem. The patch applies on 4.8 branch without problems and make all-gcc works. OK for 4.8, too? Hum. I suppose so, since it's

[PING] Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-08-05 Thread Oleg Endo
Hello, Any comments? (patch is here: http://gcc.gnu.org/ml/gcc-patches/2013-07/msg01315.html) Cheers, Oleg On Sat, 2013-07-27 at 14:52 +0200, Oleg Endo wrote: Hi, On Fri, 2013-07-26 at 08:51 +0200, Uros Bizjak wrote: BTW: I am not c++ expert, but doesn't c++ offer some sort of

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-08-05 Thread Richard Henderson
On 07/27/2013 02:52 AM, Oleg Endo wrote: gcc/ChangeLog: * recog.h (rtx (*insn_gen_fn) (rtx, ...)): Replace typedef with new class insn_gen_fn. * expr.c (move_by_pieces_1, store_by_pieces_2): Replace argument rtx (*) (rtx, ...) with insn_gen_fn. * genoutput.c

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-08-05 Thread Oleg Endo
On Mon, 2013-08-05 at 11:42 -1000, Richard Henderson wrote: On 07/27/2013 02:52 AM, Oleg Endo wrote: gcc/ChangeLog: * recog.h (rtx (*insn_gen_fn) (rtx, ...)): Replace typedef with new class insn_gen_fn. * expr.c (move_by_pieces_1, store_by_pieces_2): Replace argument rtx

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-08-05 Thread Richard Henderson
On 08/05/2013 12:32 PM, Oleg Endo wrote: Thanks, committed as rev 201513. 4.8 also has the same problem. The patch applies on 4.8 branch without problems and make all-gcc works. OK for 4.8, too? Hum. I suppose so, since it's relatively self-contained. I suppose the out-of-tree openrisc

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-07-27 Thread Oleg Endo
Hi, On Fri, 2013-07-26 at 08:51 +0200, Uros Bizjak wrote: BTW: I am not c++ expert, but doesn't c++ offer some sort of abstraction to get rid of + union { +rtx (*argc0) (void); +rtx (*argc1) (rtx); +rtx (*argc2) (rtx, rtx); +rtx (*argc3) (rtx, rtx, rtx); +rtx

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-07-27 Thread Oleg Endo
On Sat, 2013-07-27 at 14:52 +0200, Oleg Endo wrote: * I had to extend the number of max. args to 16, otherwise the SH backend's sync.md code wouldn't compile. The error message was misleading. It wasn't sync.md but some other SH insn gen func that takes 16 args. Anyway, doesn't change the

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-07-26 Thread Uros Bizjak
Hello! The (static arg) generator functions are casted to a var arg function pointer, making the assumption that the ABI for passing the arguments will be the same as for static arguments. This isn't a valid assumption on all architectures, var args might for example be passed on the stack,

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-07-11 Thread Stefan Kristiansson
On Wed, Jul 10, 2013 at 09:18:53AM +0200, Andreas Schwab wrote: I don't think there is a need to conditionalize this on HAVE_DESIGNATED_UNION_INITIALIZERS. All function pointers are alike, so it should be good enough to cast on assignment and use the right alternative on call. You mean

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-07-11 Thread Andreas Schwab
Stefan Kristiansson stefan.kristians...@saunalahti.fi writes: You mean something like this? Yes, that's what I had in mind. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 And now for something completely

Re: [PATCH] Fix illegal cast to rtx (*insn_gen_fn) (rtx, ...)

2013-07-10 Thread Andreas Schwab
Stefan Kristiansson stefan.kristians...@saunalahti.fi writes: @@ -291,14 +290,41 @@ const char *const *multi; insn_output_fn function; } output; + union { +rtx (*argc0) (void); +rtx (*argc1) (rtx); +rtx (*argc2) (rtx, rtx); +rtx (*argc3)