Blame SOURCES/gcc48-pr80692.patch

85359c
2017-06-27  Segher Boessenkool  <segher@kernel.crashing.org>
85359c
85359c
	Backport from trunk
85359c
	2017-05-17  Segher Boessenkool  <segher@kernel.crashing.org>
85359c
85359c
	PR middle-end/80692
85359c
	* real.c (do_compare): Give decimal_do_compare preference over
85359c
	comparing just the signs.
85359c
85359c
	* gcc.c-torture/execute/pr80692.c: New testcase.
85359c
85359c
--- gcc/real.c
85359c
+++ gcc/real.c
85359c
@@ -950,12 +950,12 @@ do_compare (const REAL_VALUE_TYPE *a, const REAL_VALUE_TYPE *b,
85359c
       gcc_unreachable ();
85359c
     }
85359c
 
85359c
-  if (a->sign != b->sign)
85359c
-    return -a->sign - -b->sign;
85359c
-
85359c
   if (a->decimal || b->decimal)
85359c
     return decimal_do_compare (a, b, nan_result);
85359c
 
85359c
+  if (a->sign != b->sign)
85359c
+    return -a->sign - -b->sign;
85359c
+
85359c
   if (REAL_EXP (a) > REAL_EXP (b))
85359c
     ret = 1;
85359c
   else if (REAL_EXP (a) < REAL_EXP (b))
85359c
--- /dev/null
85359c
+++ gcc/testsuite/gcc.c-torture/execute/pr80692.c
85359c
@@ -0,0 +1,11 @@
85359c
+int main () {
85359c
+	_Decimal64 d64 = -0.DD;
85359c
+
85359c
+	if (d64 != 0.DD)
85359c
+		__builtin_abort ();
85359c
+
85359c
+	if (d64 != -0.DD)
85359c
+		__builtin_abort ();
85359c
+
85359c
+	return 0;
85359c
+}
85359c
--- /dev/null
85359c
+++ gcc/testsuite/gcc.c-torture/execute/pr80692.x
85359c
@@ -0,0 +1,7 @@
85359c
+load_lib target-supports.exp
85359c
+
85359c
+if { ! [check_effective_target_dfp] } {
85359c
+        return 1
85359c
+}
85359c
+
85359c
+return 0