re PR target/58757 (Advertise the lack of denormal support on alpha without -mieee)

2014-09-11  Marc Glisse  <marc.glisse@inria.fr>

	PR target/58757
gcc/c-family/
	* c-cppbuiltin.c (builtin_define_float_constants): Correct
	__*_DENORM_MIN__ without denormals.
gcc/
	* ginclude/float.h (FLT_TRUE_MIN, DBL_TRUE_MIN, LDBL_TRUE_MIN):
	Directly forward to __*_DENORM_MIN__.
gcc/testsuite/
	* gcc.dg/c11-true_min-1.c: New testcase.

From-SVN: r215191
This commit is contained in:
Marc Glisse 2014-09-11 20:55:37 +00:00
parent a827d9b194
commit 179b5a554c
6 changed files with 49 additions and 34 deletions

View file

@ -1,3 +1,9 @@
2014-09-11 Marc Glisse <marc.glisse@inria.fr>
PR target/58757
* ginclude/float.h (FLT_TRUE_MIN, DBL_TRUE_MIN, LDBL_TRUE_MIN):
Directly forward to __*_DENORM_MIN__.
2014-09-11 David Malcolm <dmalcolm@redhat.com>
* rtl.h (LABEL_REF_LABEL): New macro.

View file

@ -1,3 +1,9 @@
2014-09-11 Marc Glisse <marc.glisse@inria.fr>
PR target/58757
* c-cppbuiltin.c (builtin_define_float_constants): Correct
__*_DENORM_MIN__ without denormals.
2014-09-10 Jakub Jelinek <jakub@redhat.com>
* c-ubsan.c (ubsan_instrument_division, ubsan_instrument_shift,

View file

@ -270,21 +270,14 @@ builtin_define_float_constants (const char *name_prefix,
sprintf (buf, "0x1p%d", 1 - fmt->p);
builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix, fp_cast);
/* For C++ std::numeric_limits<T>::denorm_min. The minimum denormalized
positive floating-point number, b**(emin-p). Zero for formats that
don't support denormals. */
/* For C++ std::numeric_limits<T>::denorm_min and C11 *_TRUE_MIN.
The minimum denormalized positive floating-point number, b**(emin-p).
The minimum normalized positive floating-point number for formats
that don't support denormals. */
sprintf (name, "__%s_DENORM_MIN__", name_prefix);
if (fmt->has_denorm)
{
sprintf (buf, "0x1p%d", fmt->emin - fmt->p);
builtin_define_with_hex_fp_value (name, type, decimal_dig,
buf, fp_suffix, fp_cast);
}
else
{
sprintf (buf, "0.0%s", fp_suffix);
builtin_define_with_value (name, buf, 0);
}
sprintf (buf, "0x1p%d", fmt->emin - (fmt->has_denorm ? fmt->p : 1));
builtin_define_with_hex_fp_value (name, type, decimal_dig,
buf, fp_suffix, fp_cast);
sprintf (name, "__%s_HAS_DENORM__", name_prefix);
builtin_define_with_value (name, fmt->has_denorm ? "1" : "0", 0);

View file

@ -178,21 +178,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#undef FLT_TRUE_MIN
#undef DBL_TRUE_MIN
#undef LDBL_TRUE_MIN
#if __FLT_HAS_DENORM__
#define FLT_TRUE_MIN __FLT_DENORM_MIN__
#else
#define FLT_TRUE_MIN __FLT_MIN__
#endif
#if __DBL_HAS_DENORM__
#define DBL_TRUE_MIN __DBL_DENORM_MIN__
#else
#define DBL_TRUE_MIN __DBL_MIN__
#endif
#if __LDBL_HAS_DENORM__
#define LDBL_TRUE_MIN __LDBL_DENORM_MIN__
#else
#define LDBL_TRUE_MIN __LDBL_MIN__
#endif
#endif /* C11 */

View file

@ -1,3 +1,8 @@
2014-09-11 Marc Glisse <marc.glisse@inria.fr>
PR target/58757
* gcc.dg/c11-true_min-1.c: New testcase.
2014-09-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/61489
@ -10,14 +15,14 @@
2014-09-11 Bernd Schmidt <bernds@codesourcery.com>
* gcc.dg/compat/struct-by-value-13_main.c (struct_by_value_13_x):
Fix declaration.
* gcc.dg/compat/struct-by-value-16a_main.c (struct_by_value_16a_x):
Fix declaration.
* gcc.dg/compat/struct-by-value-17a_main.c (struct_by_value_17a_x):
Fix declaration.
* gcc.dg/compat/struct-by-value-18a_main.c (struct_by_value_18a_x):
Fix declaration.
* gcc.dg/compat/struct-by-value-13_main.c (struct_by_value_13_x):
Fix declaration.
* gcc.dg/compat/struct-by-value-16a_main.c (struct_by_value_16a_x):
Fix declaration.
* gcc.dg/compat/struct-by-value-17a_main.c (struct_by_value_17a_x):
Fix declaration.
* gcc.dg/compat/struct-by-value-18a_main.c (struct_by_value_18a_x):
Fix declaration.
2014-09-10 Jan Hubicka <hubicka@ucw.cz>

View file

@ -0,0 +1,17 @@
/* { dg-do run } */
/* { dg-options "-std=c11" } */
/* Test that the smallest positive value is not 0. This needs to be true
even when denormals are not supported, so we do not pass any flag
like -mieee. If it fails on alpha, see PR 58757. */
#include <float.h>
int main(){
volatile float f = FLT_TRUE_MIN;
volatile double d = DBL_TRUE_MIN;
volatile long double l = LDBL_TRUE_MIN;
if (f == 0 || d == 0 || l == 0)
__builtin_abort ();
return 0;
}