[Patch : H8300] Fix regressions for bit related instructions

Kaushik Phatak Kaushik.Phatak@kpitcummins.com
Mon Mar 8 07:59:00 GMT 2010


Hi,

>> Thanks. One question -- should the other div patterns also have 
>> the "can_delay" attribute set to "no"? If so I can make that 
>> update to the patch.

This patch was applied for a particular testcase that generated this
pattern. Other div patterns including this one may not need this fix
anymore as the below patch which has been recently installed takes 
care of delay slot scheduling at a higher level,
http://gcc.gnu.org/ml/gcc-patches/2010-02/msg00149.html

But, it might still be a good idea to have a test case to check the
div after a branch. The below modified testcase uses a div* to check
other div patterns.
Please comment.

Regards,
Kaushik Phatak
www.kpitgnutools.com 

=======================Start of Patch================================
ChangeLog
2010-03-08  Kaushik Phatak  <kaushik.phatak@kpitcummins.com>

        * gcc.dg/h8300-div-delay-slot.c: New test.


diff -uprN trunk.orig/gcc/testsuite/gcc.dg/h8300-div-delay-slot.c trunk/gcc/testsuite/gcc.dg/h8300-div-delay-slot.c
--- trunk.orig/gcc/testsuite/gcc.dg/h8300-div-delay-slot.c	1970-01-01 05:30:00.000000000 +0530
+++ trunk/gcc/testsuite/gcc.dg/h8300-div-delay-slot.c	2010-03-08 11:47:03.000000000 +0530
@@ -0,0 +1,19 @@
+/* Make sure that the H8 backend does not generate a div
+   instruction in a delay slot. */
+/* { dg-options "-Os" } */
+/* { dg-skip-if "" { "h8300*-*-*" } "*" "-msx*" }  */
+/* { dg-final { scan-assembler-not "\tbra/s\t.*\n\tdiv*" } } */
+
+extern volatile unsigned long timer_ticks;
+#define timer_ms_elapsed(ticks) (((unsigned long)(timer_ticks-ticks))/10)
+unsigned long ticks;
+
+unsigned tst_read( unsigned char idx )
+{
+        switch( idx )
+        {
+                case 0x62: return timer_ms_elapsed(ticks);
+                case 0x61: return timer_ticks;
+                default: return 0;
+        }
+}
=========================End Of Patch================================



More information about the Gcc-patches mailing list