https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87390
--- Comment #10 from Joseph S. Myers <jsm28 at gcc dot gnu.org> --- Author: jsm28 Date: Wed Sep 26 21:14:16 2018 New Revision: 264656 URL: https://gcc.gnu.org/viewcvs?rev=264656&root=gcc&view=rev Log: Support excess precision for integer / floating-point comparisons (PR c/87390). In C11, implicit conversions from integer to floating-point types produce results with the range and precision of the corresponding evaluation format rather than only those of the type implicitly converted to. This patch implements that case of C11 excess precision semantics in the case of a comparison between integer and floating-point types, previously missed when implementing other cases of excess precision for such implicit conversions. As with other such fixes, this patch conservatively follows the reading of C99 where conversions from integer to floating-point do not produce results with excess precision and so the change is made for C11 mode only. Bootstrapped with no regressions on x86_64-pc-linux-gnu. gcc/c: PR c/87390 * c-typeck.c (build_binary_op): Use excess precision for comparisons of integers and floating-point for C11 and later. gcc/testsuite: PR c/87390 * gcc.target/i386/excess-precision-9.c, gcc.target/i386/excess-precision-10.c: New tests. Added: trunk/gcc/testsuite/gcc.target/i386/excess-precision-10.c trunk/gcc/testsuite/gcc.target/i386/excess-precision-9.c Modified: trunk/gcc/c/ChangeLog trunk/gcc/c/c-typeck.c trunk/gcc/testsuite/ChangeLog