Blame SOURCES/gcc48-pr80692.patch

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