This is the mail archive of the
mailing list for the GCC project.
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
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);
If this is a C front-end specific hook, then putting "always" in the
name is a bit misleading. Maybe something like
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com