This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RS6000 emitting sign extention for unsigned type


On Tue, Jan 15, 2019 at 04:48:27PM +0530, kamlesh kumar wrote:
> Hi all,
> 
> Analysed it further and find out that
> function ' rs6000_promote_function_mode ' (rs6000.c) needs modifcation.
> """
> static machine_mode
> rs6000_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
>                               machine_mode mode,
>                               int *punsignedp ATTRIBUTE_UNUSED,
>                               const_tree, int)
> {
>   PROMOTE_MODE (mode, *punsignedp, type);
>   return mode;
> }
> """
> Here, This function is promoting the mode but
> it is not even touching 'punsignedp' and it is always initialized to zero
> by default.
> So in all cases 'punsignedp' remain zero even if it is for unsigned type.
> which cause the sign extension to happen  even for unsigned type.
> 
> is there any way to set 'punsignedp' appropriately here.

No.  The call to promote_function_mode in emit_library_call_value_1
does not pass type info (because it isn't available for libcalls).

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]