]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
m68k.md (beq0_di): Generate correct (and more efficient) code when...
authorJeffrey A Law <law@cygnus.com>
Sat, 29 Aug 1998 13:53:27 +0000 (13:53 +0000)
committerJeff Law <law@gcc.gnu.org>
Sat, 29 Aug 1998 13:53:27 +0000 (07:53 -0600)
        * m68k.md (beq0_di): Generate correct (and more efficient) code when
        the clobbered operand overlaps with an input.
        (bne0_di): Similarly.
Fixes bug from m68k-netbsd folks.

From-SVN: r22081

gcc/ChangeLog
gcc/config/m68k/m68k.md

index 1c4e804a6d7451d14088f3290f494796275088f2..afb7fcdf5db9c3b2b58ee4c80a1144c474ba1cd6 100644 (file)
@@ -1,3 +1,9 @@
+Sat Aug 29 14:48:12 1998  Jeffrey A Law  (law@cygnus.com)
+
+       * m68k.md (beq0_di): Generate correct (and more efficient) code when
+       the clobbered operand overlaps with an input.
+       (bne0_di): Similarly.
+
 Sat Aug 29 12:38:54 1998  Jeffrey A Law  (law@cygnus.com)
 
        * NEWS: Various updates.
index de3c84625faa11a4c57ecc8346ba7fcb94eace2d..4abcdeb80f4deef48d13804035ad80e774c3004e 100644 (file)
     operands[3] = adj_offsettable_operand (operands[0], 4);
   if (! ADDRESS_REG_P (operands[0]))
     {
+      if (reg_overlap_mentioned_p (operands[2], operands[0]))
+       {
+         if (reg_overlap_mentioned_p (operands[2], operands[3]))
+           {
+#ifdef MOTOROLA
+             return \"or%.l %0,%2\;jbeq %l1\";
+#else
+             return \"or%.l %0,%2\;jeq %l1\";
+#endif
+           }
+         else
+           {
+#ifdef MOTOROLA
+             return \"or%.l %3,%2\;jbeq %l1\";
+#else
+             return \"or%.l %3,%2\;jeq %l1\";
+#endif
+           }
+       }
 #ifdef MOTOROLA
       return \"move%.l %0,%2\;or%.l %3,%2\;jbeq %l1\";
 #else
     operands[3] = adj_offsettable_operand (operands[0], 4);
   if (!ADDRESS_REG_P (operands[0]))
     {
+      if (reg_overlap_mentioned_p (operands[2], operands[0]))
+       {
+         if (reg_overlap_mentioned_p (operands[2], operands[3]))
+           {
+#ifdef MOTOROLA
+             return \"or%.l %0,%2\;jbne %l1\";
+#else
+             return \"or%.l %0,%2\;jne %l1\";
+#endif
+           }
+         else
+           {
+#ifdef MOTOROLA
+             return \"or%.l %3,%2\;jbne %l1\";
+#else
+             return \"or%.l %3,%2\;jne %l1\";
+#endif
+           }
+       }
 #ifdef MOTOROLA
       return \"move%.l %0,%2\;or%.l %3,%2\;jbne %l1\";
 #else