+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.
+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,
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);
#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 */
+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
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>
--- /dev/null
+/* { 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;
+}