On Tue, 25 Oct 2011, Frederic Riss wrote: > Some time ago, I tried to read the C standard to see what ports were > authorized to do with regard to that kind of issues. I (most > certainly wrongly) came to the conclusion that it was conformant to > generate an insn doing (set x (mul:DF (float_extend:DF y) > (float_extend:DF y))) for a pattern of (set x (float_extend:DF (mul:SF > y z))). The parts that lead me to believe this were eg. the paragaph > on FP contracted expressions (6.5.8) and the sentence on floating > point expression precision (6.3.1.8.2) that seem to allow a port to > compute results in higher precisions than requested.
Contracting (which is independent from excess precision) is controlled by -ffp-contract. This can operate at the very latest at the GIMPLE level (it needs to know about original expression boundaries to operate correctly); by the time you get to RTL the relevant information is long gone and you can't transform between the two patterns you give. -ffp-contract=on is actually an alias for -ffp-contract=off because of lack of expression boundary information. -- Joseph S. Myers jos...@codesourcery.com