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



--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-21 
13:55:41 UTC ---

Or rather convert.c:convert_to_real:



  /* Propagate the cast into the operation.  */

  if (itype != type && FLOAT_TYPE_P (type))

    switch (TREE_CODE (expr))

      {

        /* Convert (float)-x into -(float)x.  This is safe for

           round-to-nearest rounding mode.  */

        case ABS_EXPR:

        case NEGATE_EXPR:

          if (!flag_rounding_math

              && TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (expr)))

            return build1 (TREE_CODE (expr), type,

                           fold (convert_to_real (type,

                                                  TREE_OPERAND (expr, 0))));

          break;



that's of course not valid for unsigned x, even when using ufloat, as the

float result is always signed.

Reply via email to