Blame SOURCES/gcc48-pr80692.patch

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