Re: Integer promotion for register based arguments

2012-07-27 Thread Eric Botcazou
The documentation for this comes under the Passing Function Arguments on the Stack section, which says: This target hook returns true if an argument declared in a prototype as an integral type smaller than int should actually be passed as an int. In addition to avoiding errors in certain

RE: Integer promotion for register based arguments

2012-07-26 Thread Jon Beniston
Hi Eric, I guess my question is what would I need to change to make it work like the ARM port? I can't see how this is being controlled. Try TARGET_PROMOTE_PROTOTYPES. Thanks, actually it does turn out to be this, but I was confused by the documentation. If this returns true, I see sign

Re: Integer promotion for register based arguments

2012-07-26 Thread Andrew Haley
On 07/26/2012 09:03 AM, Jon Beniston wrote: Hi Eric, I guess my question is what would I need to change to make it work like the ARM port? I can't see how this is being controlled. Try TARGET_PROMOTE_PROTOTYPES. Thanks, actually it does turn out to be this, but I was confused by the

Integer promotion for register based arguments

2012-07-25 Thread Jon Beniston
Hi, I've tried compiling the following program targeting both MIPS, LM32 and ARM. long a, b; void func(short p) { b = (long)p; } int main() { if(a 2) func((short)a); return 0; } For MIPS and LM32, truncation is performed in the calling function and

Re: Integer promotion for register based arguments

2012-07-25 Thread Andrew Haley
On 07/25/2012 12:15 PM, Jon Beniston wrote: For MIPS and LM32, truncation is performed in the calling function and sign extension in the called function. One of these operations seems redundant. For ARM, truncation is performed in the caller, but sign-extension isn't performed in the callee,

RE: Integer promotion for register based arguments

2012-07-25 Thread Jon Beniston
Hi Andrew, On 07/25/2012 12:15 PM, Jon Beniston wrote: For MIPS and LM32, truncation is performed in the calling function and sign extension in the called function. One of these operations seems redundant. For ARM, truncation is performed in the caller, but sign-extension isn't

Re: Integer promotion for register based arguments

2012-07-25 Thread Eric Botcazou
I guess my question is what would I need to change to make it work like the ARM port? I can't see how this is being controlled. Try TARGET_PROMOTE_PROTOTYPES. -- Eric Botcazou

RE: Integer promotion for register based arguments

2012-07-25 Thread Jon Beniston
Hi Eric, I guess my question is what would I need to change to make it work like the ARM port? I can't see how this is being controlled. Try TARGET_PROMOTE_PROTOTYPES. For all 3 targets I believe this returns true (Both MIPS and LM32 use hook_bool_const_tree_true), so I presume it must

Re: Integer promotion for register based arguments

2012-07-25 Thread Andrew Haley
On 07/25/2012 04:52 PM, Jon Beniston wrote: Hi Eric, I guess my question is what would I need to change to make it work like the ARM port? I can't see how this is being controlled. Try TARGET_PROMOTE_PROTOTYPES. For all 3 targets I believe this returns true (Both MIPS and LM32 use