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



--- Comment #5 from argentinator.gcc.questions at outlook dot com 2013-02-19 
18:58:17 UTC ---

(In reply to comment #4)

> This looks like it's just an issue with the diagnostic text 

> (binary_op_error being called with the type in which the floating-point 

> operand is being represented, rather than with its semantic type).



Is this "type/semantic type" issue related to the following observation?



I tried to print the value of fpclassify for a 'subnormal' value whose type is

'float' or 'double', but it seems the compiler considers everything as a 'long

double'. The source code would be:



------------------------------------------------------------------------------

#include <math.h>

#include <float.h>

#include <stdio.h>

int main(void) {

    double x = DBL_MIN / 1024.0;

    long double z = LDBL_MIN / 1024.0;

    printf("x == %a\n\nClass of x == %X\n\nClass of z == %X\n", 

           x, fpclassify(x), fpclassify(z));

}

------------------------------------------------------------------------------

(As always, I am running on Windows 7, MinGW, GCC 4.7.2, 

command line option -std=c99, and I have FLT_EVAL_METHOD == 2).



My output is:

------------------------

x == 0x8p-1035            /* This is a 'double subnormal' value */



Class of x == 400         /* x is 'double' and normal, so this seems wrong */



Class of z == 4400        /* z is 'long double' and 'subnormal': OK */

------------------------

Reply via email to