[parisc-linux-cvs] Re: 64 bit compiler bug

amodra@one.net.au amodra@one.net.au
Wed, 30 May 2001 11:00:27 +0930


On Tue, May 29, 2001 at 06:18:08PM -0600, John Marvin wrote:
> 
> It turns out that the 0409 xc has the same bug as the 0307 xc, and I've
> also tried the latest native 64 bit gcc, and it generates the same code
> as the 0409 xc. While I thought the 0409 xc fixed the problem, it just
> rearranged the code, but it still has the same basic failure, i.e. it
> uses r2 as a general register, and then the compiler doesn't take into
> account that r2 got trashed when calling millicode.
> 
> I haven't checked to see if an equivalent bug exists in the 32 bit gcc.

Hi John,
  It's in the 32-bit compiler too. :-(

I think this ought to fix it.

Index: pa.md
===================================================================
RCS file: /home/cvs/parisc/gcc/gcc/config/pa/pa.md,v
retrieving revision 1.7
diff -u -p -r1.7 pa.md
--- pa.md	2001/04/17 00:45:01	1.7
+++ pa.md	2001/05/30 01:10:00
@@ -3927,6 +3927,7 @@
 (define_insn ""
   [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
    (clobber (match_operand:SI 0 "register_operand" "=a"))
+   (clobber (reg:SI 2))
    (clobber (reg:SI 26))
    (clobber (reg:SI 25))
    (clobber (reg:SI 31))]
@@ -4030,6 +4031,7 @@
 	(div:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
    (clobber (match_operand:SI 1 "register_operand" "=a"))
    (clobber (match_operand:SI 2 "register_operand" "=&r"))
+   (clobber (reg:SI 2))
    (clobber (reg:SI 26))
    (clobber (reg:SI 25))
    (clobber (reg:SI 31))]
@@ -4085,6 +4087,7 @@
 	(udiv:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
    (clobber (match_operand:SI 1 "register_operand" "=a"))
    (clobber (match_operand:SI 2 "register_operand" "=&r"))
+   (clobber (reg:SI 2))
    (clobber (reg:SI 26))
    (clobber (reg:SI 25))
    (clobber (reg:SI 31))]
@@ -4137,6 +4140,7 @@
   [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25)))
    (clobber (match_operand:SI 0 "register_operand" "=a"))
    (clobber (match_operand:SI 1 "register_operand" "=&r"))
+   (clobber (reg:SI 2))
    (clobber (reg:SI 26))
    (clobber (reg:SI 25))
    (clobber (reg:SI 31))]
@@ -4189,6 +4193,7 @@
   [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25)))
    (clobber (match_operand:SI 0 "register_operand" "=a"))
    (clobber (match_operand:SI 1 "register_operand" "=&r"))
+   (clobber (reg:SI 2))
    (clobber (reg:SI 26))
    (clobber (reg:SI 25))
    (clobber (reg:SI 31))]