6809: Build levee, sh and kernel with -fno-cprop-registers
authorTormod Volden <debian.tormod@gmail.com>
Sun, 14 Aug 2016 11:47:23 +0000 (13:47 +0200)
committerAlan Cox <alan@linux.intel.com>
Sun, 14 Aug 2016 15:52:38 +0000 (16:52 +0100)
Something goes wrong in gcc6809's cprop_hardreg pass if there are
exg,add,exg patterns around.

The kernel seemed fine up to now, but add the flag just to avoid
any undiscovered or future issues.

Remove the gratuitous() workaround from sh/blok.c

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Applications/V7/cmd/sh/Makefile.6809
Applications/V7/cmd/sh/blok.c
Applications/V7/cmd/sh/main.c
Applications/levee/Makefile.6809
Kernel/cpu-6809/rules.mk

index 620c371..b940f78 100644 (file)
@@ -5,6 +5,8 @@ ASM = m6809-unknown-as
 AR = m6809-unknown-ar
 LINKER = lwlink
 CFLAGS =  -I../../../../Library/include -I../../../../Library/include/6809 -Wall -pedantic -fno-strict-aliasing
+# Workaround for gcc6809 bug - register copy propagation issue
+CFLAGS += -fno-cprop-registers
 COPT = -Os
 LINKER_OPT = --format=raw -L../../../../Library/libs -lc6809
 LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name))
index 9f276ad..e17250f 100644 (file)
@@ -53,7 +53,6 @@ ADDRESS alloc(POS nbytes)
                                        p->word = q->word;
 
 /*                                printf("H%d ", ADR(q) - ADR(p)); */
-                                gratuitous_call();
                                 /* Big enough hole */
                                if (ADR(q) - ADR(p) >= rbytes) {
                                        /* blokp is the first byte after
@@ -62,7 +61,6 @@ ADDRESS alloc(POS nbytes)
                                        /* Splitting ? */
                                        if (q > blokp) {
 /*                                             printf("S");*/
-                                                gratuitous_call();
                                                blokp->word = p->word;
                                         }
                                         /* Update our block */
index e2127d1..2c0b136 100644 (file)
@@ -193,7 +193,3 @@ void Ldup(register int fa, register int fb)
        close(fa);
        fcntl(fb, F_SETFD, FD_CLOEXEC);
 }
-
-void gratuitous_call(void)
-{
-}
index be46ff8..79da4f0 100644 (file)
@@ -6,6 +6,8 @@ AR = m6809-unknown-ar
 LINKER = lwlink
 CFLAGS = -I../../Library/include -I../../Library/include/6809
 COPT = -Os -fomit-frame-pointer
+# Workaround for gcc6809 bug - register copy propagation issue
+COPT += -fno-cprop-registers
 LINKER_OPT = --format=raw -L../../Library/libs -lc6809
 LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name))
 LINKER_OPT += -L$(LIBGCCDIR) -lgcc
index 084b932..c7921d8 100644 (file)
@@ -3,6 +3,8 @@ export CROSS_LD=lwlink
 export CROSS_CC = m6809-unknown-gcc
 #export CROSS_CCOPTS=-Wall -O2 -I$(ROOT_DIR)/cpu-6809 -I$(ROOT_DIR)/platform-$(TARGET) -I$(ROOT_DIR)/include
 export CROSS_CCOPTS=-c -Wall -Os -msoft-reg-count=0 -mfar-stack-param -I$(ROOT_DIR)/cpu-6809 -I$(ROOT_DIR)/platform-$(TARGET) -I$(ROOT_DIR)/include
+# Workaround for gcc6809 bug - register copy propagation issue
+CROSS_CCOPTS += -fno-cprop-registers
 export CROSS_CC_SEG1=-mcode-section=.text -mfar-code-page=1
 export CROSS_CC_SEG2=-mcode-section=.text2 -mfar-code-page=2
 #Given the compactness we don't need a CODE3 segment really