This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: RL78: Fix gcc testsuite failures


Hi DJ,

  Please can I apply the patch below to fix some RL78 gcc testsuite
  failures ?

  The patch does two things:  Firstly in the RL78 assembler version of
  the __addsf3 function it fixes a corner case where rounding up the 
  fraction results in an overflow into an unused bit.  The problem here
  was that the exponent was not being increased to cover this lost bit.

  The second fix is to the RL78 specific dead-code elimination pass
  which was failing to note the REGs inside a MEM are used when that MEM
  is the destination of a SET insn.

  Tested with no regressions and lots of fixes using an rl78-elf
  toolchain.

  OK to apply ?

Cheers
  Nick

libgcc/ChangeLog
2015-02-04  Nick Clifton  <nickc@redhat.com>

	* config/rl78/fpmath-sf.S (__addsf3): Add code for the special
          case where rounding the fraction up results in an overflow
          into unused bits.

gcc/ChangeLog
2015-02-04  Nick Clifton  <nickc@redhat.com>

	* config/rl8/rl78.c (rl78_note_reg_set): If the dest is a MEM
          note that any REGs that is contains are being USED.

Index: libgcc/config/rl78/fpmath-sf.S
===================================================================
--- libgcc/config/rl78/fpmath-sf.S	(revision 220389)
+++ libgcc/config/rl78/fpmath-sf.S	(working copy)
@@ -517,8 +517,14 @@
 	movw	ax, A_FRAC_L
 	addw	ax, #1
 	movw	A_FRAC_L, ax
-	sknc
+	bnc	$1f
 	incw	A_FRAC_H
+
+	;; If the rounding set the bit beyond the end of the fraction, increment the exponent.
+	mov	a, A_FRAC_HH
+	bf	a.1, $1f
+	incw	A_EXP
+	
 1:	
 	movw	ax, A_FRAC_H
 	shrw	ax, 1
Index: gcc/config/rl78/rl78.c
===================================================================
--- gcc/config/rl78/rl78.c	(revision 220393)
+++ gcc/config/rl78/rl78.c	(working copy)
@@ -3577,6 +3608,9 @@
 {
   int r, i;
 
+  if (GET_CODE (d) == MEM)
+    rl78_note_reg_uses (dead, XEXP (d, 0), insn);
+
   if (GET_CODE (d) != REG)
     return;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]