Commit f32c53c2 by Anthony Green Committed by Anthony Green

��> 2003-06-07�� Anthony Green�� <green@redhat.com> ��>...

��> 2003-06-07�� Anthony Green�� <green@redhat.com>
��>
��>������������* parse.y (patch_cast): Fix conversions from floating-point to
��>������������integral types.

From-SVN: r67631
parent 10e9fecc
2003-06-08 Anthony Green <green@redhat.com>
* parse.y (patch_cast): Fix conversions from floating-point to
integral types.
2003-06-08 Neil Booth <neil@daikokuya.co.uk> 2003-06-08 Neil Booth <neil@daikokuya.co.uk>
* Make-lang.in: Update. * Make-lang.in: Update.
......
...@@ -14224,14 +14224,15 @@ patch_cast (tree node, tree wfl_op) ...@@ -14224,14 +14224,15 @@ patch_cast (tree node, tree wfl_op)
if (cast_type == op_type) if (cast_type == op_type)
return node; return node;
/* float and double type are converted to the original type main /* A narrowing conversion from a floating-point number to an
variant and then to the target type. */ integral type requires special handling (5.1.3). */
if (JFLOAT_TYPE_P (op_type) && TREE_CODE (cast_type) == CHAR_TYPE) if (JFLOAT_TYPE_P (op_type) && JINTEGRAL_TYPE_P (cast_type))
op = convert (integer_type_node, op); if (cast_type != long_type_node)
op = convert (integer_type_node, op);
/* Try widening/narowwing convertion. Potentially, things need /* Try widening/narrowing convertion. Potentially, things need
to be worked out in gcc so we implement the extreme cases to be worked out in gcc so we implement the extreme cases
correctly. fold_convert() needs to be fixed. */ correctly. fold_convert() needs to be fixed. */
return convert (cast_type, op); return convert (cast_type, op);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment