[PATCH] Fix PR target/6561 (regression from egcs 1.1.2)

Jakub Jelinek jakub@redhat.com
Sun May 5 13:34:00 GMT 2002


Hi!

The following patch fixes an execute/950511-1.c with
-O -mcpu=ultrasparc -mv8plus miscompilation (-mv8plus is the default
on Solaris if -mcpu=v9 or -mcpu=ultrasparc).
Ok to commit?
Mark, ok for branch (I've verified it doesn't fail with egcs 1.1.2
-O -mcpu=ultrasparc -mv8plus, though it fails with 2.96-RH and 3.0.x)?

2002-05-05  Jakub Jelinek  <jakub@redhat.com>

	PR target/6561
	* config/sparc/sparc.md (muldi3_v8plus): Handle %1 equal to %2.

--- gcc/config/sparc/sparc.md.jj	Thu May  2 11:59:29 2002
+++ gcc/config/sparc/sparc.md	Sun May  5 21:56:45 2002
@@ -5803,6 +5803,13 @@
       else
 	return \"sllx\\t%H1, 32, %3\\n\\tor\\t%L1, %3, %3\\n\\tmulx\\t%3, %2, %3\\n\\tsrlx\\t%3, 32, %H0\\n\\tmov\\t%3, %L0\";
     }
+  else if (rtx_equal_p (operands[1], operands[2]))
+    {
+      if (which_alternative == 1)
+	return \"or\\t%L1, %H1, %H1\\n\\tmulx\\t%H1, %H1, %L0\;srlx\\t%L0, 32, %H0\";
+      else
+	return \"sllx\\t%H1, 32, %3\\n\\tor\\t%L1, %3, %3\\n\\tmulx\\t%3, %3, %3\\n\\tsrlx\\t%3, 32, %H0\\n\\tmov\\t%3, %L0\";
+    }
   if (sparc_check_64 (operands[2], insn) <= 0)
     output_asm_insn (\"srl\\t%L2, 0, %L2\", operands);
   if (which_alternative == 1)

	Jakub



More information about the Gcc-patches mailing list