[Bug tree-optimization/27394] double -> char conversion varies with optimization level

amylaar at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue May 2 17:53:00 GMT 2006



------- Comment #1 from amylaar at gcc dot gnu dot org  2006-05-02 17:53 -------
In 3.x, double -> char/int conversion was done consistently with the documented
behaviour of integer -> signed integer type conversion.
http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Integers-implementation.html#Integers-implementation.

In 4.1, fold-const.c:fold_convert_const_int_from_real implements java
semantics.

I think for consistency, when folding a floating point value to an integer
type of smaller width than integer_type_node, it should be converted to
integer_type first, and then from there to the target type, using the
language-specific semantics.


-- 

amylaar at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.1.0 4.2.0
      Known to work|                            |3.2.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27394



More information about the Gcc-bugs mailing list