Blame SOURCES/gcc48-pr80692.patch

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