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: Promoting floats to doubles?


On Tue, 2004-05-04 at 10:35, Kean Johnston wrote:
> The first case I think should be protected by something like
> #if TARGET_PROMOTES_FLOAT_TO_DOUBLE. My only concern is that I dont
> know if thats the right function to put the conversion in, as I dont
> know all of the circumstances under which default_conversion() is
> called. Perhaps the right thing to do is isolate any changes to
> convert_arguments().

This is why I suggested looking at the old K&R C support, which is
presumably exactly what you need to be compatible with the SCO compiler.

So look at gcc-2.8.1, grep for flag_traditional... I see code in
default_conversion for arguments.  store_parm_decls and
combine_parm_decls for parameters.  And grokdeclarator for return
values.  The last one is optional, since not all K&R C compilers
promoted return values.  So the default_conversion change seems right. 
The store_parm_decls/combine_parm_decls stuff has changed a bit since
2.8.1, so you might have to look at that a bit closer.

> #ifdef TARGET_ALWAYS_PROMOTES_FLOATS
>    else if (TREE_CODE (type) = REAL_TYPE)
>      parmval = convert (double_type_node, parmval);
> #endif

If this is a C front-end specific hook, then putting "always" in the
name is a bit misleading.  Maybe something like
TARGET_KANDRC_PROMOTE_FLOATS.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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