Patch RFA: Let languages control -ffast-math

Joseph S. Myers joseph@codesourcery.com
Sun Feb 6 19:03:00 GMT 2011


On Sat, 5 Feb 2011, Ian Lance Taylor wrote:

> This patch adds a new language hook apply_combined_option which lets the
> frontend control whether a meta-option like -ffast-math should affect
> another more specific option.  This is a general mechanism and is named
> accordingly, but in fact at present it seems only appropriate for
> -ffast-math and -funsafe-math-optimizations, so I would be willing to
> give it a more specific name if that seems appropriate.

opts.c is not meant to use langhooks; I moved anything that would be 
problematic to share with the driver into opts-global.c so that opts.c can 
in future be shared with the driver.  So it would be better in that 
regard, though less general, for the init_options langhook to set 
something in the gcc_options struct indicating that a particular option 
should not be controlled by -ffast-math.

(Various targets have linker specs 
%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} and it would be 
good if in future they could be based on logical state of 
flag_unsafe_math_optimizations in the driver, so knowing these 
implications in the driver is potentially useful.  But certainly such 
driver processing can only operate with language-independent defaults 
since it may be linking a multi-language program.)

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list