[PATCH] Bugfix: Additional parameter for canonicalize comparison

2012-12-06 Thread Andreas Krebbel
Hi, the attached patch fixes a problem I encountered with Richards patch adding an extvz expander to the s390 backend. According to its definition the CANONICALIZE_COMPARISON macro is allowed to modify the two operands as well as the comparison code in order to make a comparison valid or more eff

[PATCH] Bugfix: Additional parameter for canonicalize comparison

2012-12-12 Thread Andreas Krebbel
Hi Richard, is the attached patch ok for ARM? Bye, -Andreas- 2012-12-12 Andreas Krebbel * target.def: Define canonicalize_comparison hook. * targhooks.h (default_canonicalize_comparison): New prototype. * targhooks.c (default_canonicalize_comparison): New function.

Re: [PATCH] Bugfix: Additional parameter for canonicalize comparison

2012-12-07 Thread Richard Henderson
On 2012-12-06 02:25, Andreas Krebbel wrote: > ! targetm.canonicalize_comparison ((int*)&compare_code, &op0, &op1, 1); The basic approach seems sound. But this cast is distinctly uncool. And why the unused return value? If you didn't need it, why add it? r~

Re: [PATCH] Bugfix: Additional parameter for canonicalize comparison

2012-12-07 Thread Oleg Endo
On Fri, 2012-12-07 at 13:37 -0600, Richard Henderson wrote: > On 2012-12-06 02:25, Andreas Krebbel wrote: > > ! targetm.canonicalize_comparison ((int*)&compare_code, &op0, &op1, 1); > > The basic approach seems sound. But this cast is distinctly uncool. > > And why the unused return value?

Re: [PATCH] Bugfix: Additional parameter for canonicalize comparison

2012-12-10 Thread Andreas Krebbel
On Sat, Dec 08, 2012 at 01:16:16AM +0100, Oleg Endo wrote: > On Fri, 2012-12-07 at 13:37 -0600, Richard Henderson wrote: > > On 2012-12-06 02:25, Andreas Krebbel wrote: > > > ! targetm.canonicalize_comparison ((int*)&compare_code, &op0, > > > &op1, 1); > > > > The basic approach seems s

Re: [PATCH] Bugfix: Additional parameter for canonicalize comparison

2012-12-10 Thread Richard Henderson
On 12/10/2012 01:50 AM, Andreas Krebbel wrote: > Ok. Here is an updated version trying to address the comments above. > > 2012-12-10 Andreas Krebbel > > * target.def: Define canonicalize_comparison hook. > * targhooks.h (default_canonicalize_comparison): New prototype. > * ta

Re: [PATCH] Bugfix: Additional parameter for canonicalize comparison

2012-12-10 Thread Oleg Endo
On Mon, 2012-12-10 at 11:22 -0800, Richard Henderson wrote: > On 12/10/2012 01:50 AM, Andreas Krebbel wrote: > > Ok. Here is an updated version trying to address the comments above. > > > > 2012-12-10 Andreas Krebbel > > > > * target.def: Define canonicalize_comparison hook. > > * targ

Re: [PATCH] Bugfix: Additional parameter for canonicalize comparison

2012-12-10 Thread Kaz Kojima
Andreas Krebbel wrote: > Index: gcc/config/sh/sh.c > === > *** gcc/config/sh/sh.c.orig > --- gcc/config/sh/sh.c [snop] > ! static void > sh_canonicalize_comparison (enum rtx_code& cmp, rtx& op0, rtx& op1, > !

Re: [PATCH] Bugfix: Additional parameter for canonicalize comparison

2012-12-11 Thread Andreas Krebbel
On 11/12/12 00:12, Kaz Kojima wrote: > Andreas Krebbel wrote: >> Index: gcc/config/sh/sh.c >> === >> *** gcc/config/sh/sh.c.orig >> --- gcc/config/sh/sh.c > [snop] >> ! static void >> sh_canonicalize_comparison (enum rtx_code& cmp,

Re: [PATCH] Bugfix: Additional parameter for canonicalize comparison

2012-12-11 Thread Kaz Kojima
Andreas Krebbel wrote: > urgs - I'll fix this. Is the patch ok with that change for sh? Yes, the sh portion is OK with that change, though it would be better to fix the users of sh_canonicalize_comparison instead of its wrapper as pointed out by rth and oleg. Regards, kaz

Re: [PATCH] Bugfix: Additional parameter for canonicalize comparison

2012-12-11 Thread Andreas Krebbel
On 11/12/12 10:16, Kaz Kojima wrote: > Andreas Krebbel wrote: >> urgs - I'll fix this. Is the patch ok with that change for sh? > > Yes, the sh portion is OK with that change, though it would be better > to fix the users of sh_canonicalize_comparison instead of its wrapper > as pointed out by rth

Re: [PATCH] Bugfix: Additional parameter for canonicalize comparison

2012-12-11 Thread Oleg Endo
On Tue, 2012-12-11 at 11:15 +0100, Andreas Krebbel wrote: > On 11/12/12 10:16, Kaz Kojima wrote: > > Andreas Krebbel wrote: > >> urgs - I'll fix this. Is the patch ok with that change for sh? > > > > Yes, the sh portion is OK with that change, though it would be better > > to fix the users of sh_