changeset 417:98888da30b35

code jump fixes (not finished)
author kono
date Mon, 25 Oct 2004 01:16:28 +0900
parents a6ed0575d731
children c73f013d07d7
files Changes Makefile.linuxzaurus Makefile.mips mc-code-arm.c mc-code-ia32.c mc-code-powerpc.c mc-codegen.c
diffstat 7 files changed, 566 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/Changes	Sun Oct 24 21:07:46 2004 +0900
+++ b/Changes	Mon Oct 25 01:16:28 2004 +0900
@@ -6229,10 +6229,25 @@
 を割り当てているな。なので、
 ## code carg6(int i, int j,int k,int l,struct arg args0)
 ##     goto carg3(args0,args0,i,j,k,l);
-で、args0 のcopyが余計に出るね。 しかもずれ方が変。
+で、args0 のcopyが余計に出るね。 しかもずれ方が変。(*)
 
 無害ではあるんだが...
 
 でも、それでバグを見つけたわけか。
 
 だいぶ、enbug しちゃったよ...
+
+emit_copy でmemmove する時には、offset は無視する。address + offset
+から、reverse に address までコピーするという意味だから。
+
+memmove は、一時レジスタを壊してしまうので、parallel assignment
+の一時には普通のレジスタは使えない。
+
+PowerPC の code segment で、引数が、CALLER_ARG つまり、関数呼び出し
+のスタックと重なっている。code_disp_offset では調整できないらしい。
+今までは、(*) のせいで余計に一時変数を取っていたので顕現しなかった
+らしい。
+
+うーん... 一応、直ったけど...
+
+他のがどんどん動かなくなる...
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.linuxzaurus	Mon Oct 25 01:16:28 2004 +0900
@@ -0,0 +1,211 @@
+CC = gcc
+# -O3
+CFLAGS = -fsigned-char -pipe -g -Wall -I. -I/home/zaurus/develop/include
+BASE=0
+STAGE=1
+MFLAGS=$(MFALGS) BASE=$(BASE) STAGE=$(STAGE)
+ARCH=powerpc
+MC=mc-$(ARCH)
+# MLIB = -lm
+PRINTF= # printf.c
+CONVERTER=conv/c.o conv/null.o
+# conv/c2cbc.o conv/cbc2c.o
+COMPLIB = mc-parse.o mc-codegen.o mc-switch.o mc-macro.o mc-tree.o
+# CODE=mc-code-ia32.c
+CODE=mc-code-$(ARCH).c
+
+all: mc mc-ia32 mc-powerpc mc-mips mc-arm
+
+mc:  mc-$(ARCH)
+	cp mc-$(ARCH) mc
+
+TAGS:
+	ctags mc-code-powerpc.c mc-code.h mc-codegen.c mc-codegen.h \
+		mc-macro.c \
+		mc-parse.c mc-tree.c mc-switch.c mc-switch.h \
+		mc.h conv/c.c conv/c.h \
+		conv/conv.h conv/convdef.h conv/null.c
+
+mc-powerpc : mc-code-powerpc.o $(COMPLIB) $(CONVERTER)
+	$(CC) -g mc-code-powerpc.o $(COMPLIB) $(CONVERTER) -o $@
+
+mc-ia32 : mc-code-ia32.o $(COMPLIB) $(CONVERTER)
+	$(CC) -g mc-code-ia32.o $(COMPLIB) $(CONVERTER) -o $@
+
+mc-mips : mc-code-mips.o $(COMPLIB) $(CONVERTER)
+	$(CC) -g mc-code-mips.o $(COMPLIB) $(CONVERTER) -o $@
+
+mc-arm : mc-code-arm.o $(COMPLIB) $(CONVERTER)
+	$(CC) -g mc-code-arm.o $(COMPLIB) $(CONVERTER) -o $@
+
+conv/conv.h: conv_func.tbl conv_func.pl
+	perl conv_func.pl
+conv/convdef.h: conv_func.tbl conv_func.pl
+	perl conv_func.pl
+conv/null.c: conv_func.tbl conv_func.pl
+	perl conv_func.pl
+
+mc.h-new:
+	perl mc-h-renum.pl mc.h > mc.h.1
+	mv mc.h.1 mc.h
+
+check-all:  check-all-c check-all-code
+
+check-all-c:
+	make check TARGET=test/basic
+	make check TARGET=test/call
+	make check TARGET=test/fact0
+	make check TARGET=test/float
+	make check TARGET=test/ifdef
+	make check TARGET=test/int
+	make check TARGET=test/macro
+	make check TARGET=test/regargs
+	make check TARGET=test/short
+	make check TARGET=test/simp
+	make check TARGET=test/simp0
+	make check TARGET=test/simp1
+	make check TARGET=test/static
+	make check TARGET=test/tmp
+	make check TARGET=test/tmp10
+	make check TARGET=test/tmp11
+	make check TARGET=test/tmp12
+	make check TARGET=test/tmp5
+	make check TARGET=test/tmp7
+	make check TARGET=test/tmp8
+	make check TARGET=test/tmp9
+	make check TARGET=test/enum
+	make check TARGET=test/obsf
+	make check TARGET=test/long
+	make check TARGET=test/tstdarg
+	make check TARGET=test/switch
+	make check TARGET=test/strinit
+	make check TARGET=test/code-gen-all
+	make check TARGET=test/bitfield
+	make check TARGET=test/bitfield1
+	make check TARGET=test/cext
+#	make check TARGET=test/scope STDFLAG="-std=gnu99"
+#MK =-make
+MK=
+check-all-code:
+	make check-code$(MK) TARGET=test/arg
+	make check-code$(MK) TARGET=test/conv
+	make check-code$(MK) TARGET=test/conv1
+	make check-code$(MK) TARGET=test/fact-a
+	make check-code$(MK) TARGET=test/fact
+	make check-code$(MK) TARGET=test/goto
+#	make check-code$(MK) TARGET=test/test1
+#	make check-code$(MK) TARGET=test/tmp1
+	make check-code$(MK) TARGET=test/tmp2
+	make check-code$(MK) TARGET=test/tmp4
+#	make check-code$(MK) TARGET=test/tmp6
+	make check-code$(MK) TARGET=test/scope
+
+check-nkf:
+	( cd nkf203; $(CC) -g -o nkf1 nkf.c utf8tbl.c )
+	( cd nkf203; ../mc-$(ARCH) -s nkf.c utf8tbl.c )
+	( cd nkf203; $(CC) -g -o nkf nkf.s utf8tbl.s )
+	( cd nkf203; perl test.pl )
+
+#	-./$(MC) -Itest/ -s $(TARGET).c
+
+check: $(MC) $(TARGET).c
+	-gcc $(STDFLAG) $(TARGET).c -o b.out $(MLIB)
+	-./b.out > $(TARGET).gcc.out
+	-./$(MC) -s $(TARGET).c
+	-gcc $(TARGET).s $(MLIB)
+	-./a.out > $(TARGET).$(MC).out
+	-diff $(TARGET).gcc.out $(TARGET).$(MC).out
+
+check-code: $(MC)
+	-./$(MC) -s $(TARGET).c
+	-gcc $(TARGET).s $(MLIB)
+	-./a.out > $(TARGET).$(MC).out
+	-diff  $(TARGET).code-out $(TARGET).$(MC).out
+check-code-make: $(MC)
+	-./$(MC) -s $(TARGET).c
+	-gcc $(TARGET).s $(MLIB)
+	-./a.out > $(TARGET).code-out
+
+test/code-gen-all.c: test/code-gen.pl test/code-gen.c
+	perl test/code-gen.pl < test/code-gen.c > test/code-gen-all.c
+
+tags:   tags-$(ARCH)
+
+tags-$(ARCH):  
+	ctags mc.h mc-code.h mc-code-$(ARCH).c  mc-codegen.c mc-codegen.h \
+		mc-parse.c mc-tree.c \
+	    conv/c.c conv/c.h \
+	    conv/conv.h conv/convdef.h 
+
+tar :
+	make clean
+	tar cBf - . | gzip > ../comp.tgz 
+
+depend :
+	makedepend mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \
+		mc-parse.c mc-tree.c mc-switch.c mc-switch.h mc.h \
+		mc-macro.c mc-macro.h mc-parse.h \
+	    conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \
+	    conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \
+                mc-code-powerpc.c \
+                mc-code-mips.c
+
+clean :
+	-rm -f mc mc-ia32 mc-powerpc mc-mips mc-arm *.bak *.s *.o *.cc mc mc1 mc2 a.out *~ core* */*.o *.bak test/*.s test/*.cc test/*.o test/*.bak test/*~ conv/*.s conv/*.cc conv/*.o conv/*.bak conv/*~ *.out */*.out *.i */*.i
+
+mc1 : b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o $(CONVERTER)
+	$(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o $(CONVERTER)
+
+mc2 : b00.s b01.s b02.s b03.s mc-macro.o  $(CONVERTER)
+	$(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s b04.s mc-macro.o $(CONVERTER)
+
+b00.s : mc-parse.c $(MC)
+	./$(MC) -s -ob00.s mc-parse.c
+b01.s : $(CODE) $(MC)
+	./$(MC) -s -ob01.s $(CODE)
+b02.s : mc-codegen.c $(MC)
+	./$(MC) -s -ob02.s mc-codegen.c
+b03.s : mc-tree.c $(MC)
+	./$(MC) -s -ob03.s mc-tree.c
+b04.s : mc-switch.c $(MC)
+	./$(MC) -s -ob04.s mc-switch.c
+
+b10.s : mc-parse.c mc1
+	./mc1 -s -ob10.s mc-parse.c
+b11.s : $(CODE) $(PRINTF) mc1
+	./mc1 -s -ob11.s $(CODE)
+b12.s : mc-codegen.c mc1
+	./mc1 -s -ob12.s mc-codegen.c
+b13.s : mc-tree.c mc1
+	./mc1 -s -ob13.s mc-tree.c
+b14.s : mc-switch.c mc1
+	./mc1 -s -ob14.s mc-switch.c
+
+b20.s : mc-parse.c mc2
+	./mc2 -s -ob20.s mc-parse.c
+b21.s : $(CODE) $(PRINTF) mc2
+	./mc2 -s -ob21.s $(CODE)
+b22.s : mc-codegen.c mc2
+	./mc2 -s -ob22.s mc-codegen.c
+b23.s : mc-tree.c mc2
+	./mc2 -s -ob23.s mc-tree.c
+b24.s : mc-switch.c mc1
+	./mc2 -s -ob24.s mc-switch.c
+
+diff :  b00.s b01.s b02.s b03.s b04.s b10.s b11.s b12.s b13.s b14.s
+	-diff b00.s b10.s
+	-diff b01.s b11.s
+	-diff b02.s b12.s
+	-diff b03.s b13.s
+	-diff b04.s b14.s
+
+diff2 :  b00.s b01.s b02.s b03.s b04.s b20.s b21.s b22.s b23.s b24.s
+	-diff b00.s b20.s
+	-diff b01.s b21.s
+	-diff b02.s b22.s
+	-diff b03.s b23.s
+	-diff b04.s b24.s
+
+
+# DO NOT DELETE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.mips	Mon Oct 25 01:16:28 2004 +0900
@@ -0,0 +1,316 @@
+CC = gcc 
+# -O3
+CFLAGS = -g -Wall -I.
+BASE=0
+STAGE=1
+MFLAGS=$(MFALGS) BASE=$(BASE) STAGE=$(STAGE)
+ARCH=mips
+MC=mc-$(ARCH)
+MLIB = -lm
+PRINTF= # printf.c
+CONVERTER=conv/c.o conv/null.o
+# conv/c2cbc.o conv/cbc2c.o
+COMPLIB = mc-parse.o mc-codegen.o mc-switch.o mc-macro.o mc-tree.o
+# CODE=mc-code-ia32.c
+CODE=mc-code-$(ARCH).c
+
+all: mc mc-ia32 mc-powerpc mc-mips
+
+mc:  mc-$(ARCH)
+	cp mc-$(ARCH) mc
+
+TAGS:
+	ctags mc-code-powerpc.c mc-code.h mc-codegen.c mc-codegen.h \
+		mc-macro.c \
+		mc-parse.c mc-tree.c mc-switch.c mc-switch.h \
+		mc.h conv/c.c conv/c.h \
+		conv/conv.h conv/convdef.h conv/null.c
+
+mc-powerpc : mc-code-powerpc.o $(COMPLIB) $(CONVERTER)
+	$(CC) -g mc-code-powerpc.o $(COMPLIB) $(CONVERTER) -o $@
+
+mc-ia32 : mc-code-ia32.o $(COMPLIB) $(CONVERTER)
+	$(CC) -g mc-code-ia32.o $(COMPLIB) $(CONVERTER) -o $@
+
+mc-mips : mc-code-mips.o $(COMPLIB) $(CONVERTER)
+	$(CC) -g mc-code-mips.o $(COMPLIB) $(CONVERTER) -o $@
+
+conv/conv.h: conv_func.tbl conv_func.pl
+	perl conv_func.pl
+conv/convdef.h: conv_func.tbl conv_func.pl
+	perl conv_func.pl
+conv/null.c: conv_func.tbl conv_func.pl
+	perl conv_func.pl
+
+mc.h-new:
+	perl mc-h-renum.pl mc.h > mc.h.1
+	mv mc.h.1 mc.h
+
+check-all:  check-all-c check-all-code
+
+check-all-c:
+	make check TARGET=test/basic
+	make check TARGET=test/call
+	make check TARGET=test/fact0
+	make check TARGET=test/float
+	make check TARGET=test/ifdef
+	make check TARGET=test/int
+	make check TARGET=test/macro
+	make check TARGET=test/regargs
+	make check TARGET=test/short
+	make check TARGET=test/simp
+	make check TARGET=test/simp0
+	make check TARGET=test/simp1
+	make check TARGET=test/static
+	make check TARGET=test/tmp
+	make check TARGET=test/tmp10
+	make check TARGET=test/tmp11
+	make check TARGET=test/tmp12
+	make check TARGET=test/tmp5
+	make check TARGET=test/tmp7
+	make check TARGET=test/tmp8
+	make check TARGET=test/tmp9
+	make check TARGET=test/enum
+	make check TARGET=test/obsf
+	make check TARGET=test/long
+	make check TARGET=test/tstdarg
+	make check TARGET=test/switch
+	make check TARGET=test/strinit
+	make check TARGET=test/code-gen-all
+	make check TARGET=test/bitfield
+	make check TARGET=test/bitfield1
+#MK =-make
+MK=
+check-all-code:
+	make check-code$(MK) TARGET=test/arg
+	make check-code$(MK) TARGET=test/conv
+	make check-code$(MK) TARGET=test/conv1
+	make check-code$(MK) TARGET=test/fact-a
+	make check-code$(MK) TARGET=test/fact
+	make check-code$(MK) TARGET=test/goto
+#	make check-code$(MK) TARGET=test/test1
+#	make check-code$(MK) TARGET=test/tmp1
+	make check-code$(MK) TARGET=test/tmp2
+	make check-code$(MK) TARGET=test/tmp4
+#	make check-code$(MK) TARGET=test/tmp6
+
+check-nkf:
+	( cd nkf203; $(CC) -g -o nkf1 nkf.c utf8tbl.c )
+	( cd nkf203; ../mc-$(ARCH) -s nkf.c utf8tbl.c )
+	( cd nkf203; $(CC) -g -o nkf nkf.s utf8tbl.s )
+	( cd nkf203; perl test.pl )
+
+#	-./$(MC) -Itest/ -s $(TARGET).c
+
+check: $(MC) $(TARGET).c
+	-gcc $(TARGET).c -o b.out $(MLIB)
+	-./b.out > $(TARGET).gcc.out
+	-./$(MC) -s $(TARGET).c
+	-gcc $(TARGET).s $(MLIB)
+	-./a.out > $(TARGET).$(MC).out
+	-diff $(TARGET).gcc.out $(TARGET).$(MC).out
+
+check-code: $(MC)
+	-./$(MC) -s $(TARGET).c
+	-gcc $(TARGET).s $(MLIB)
+	-./a.out > $(TARGET).$(MC).out
+	-diff  $(TARGET).code-out $(TARGET).$(MC).out
+check-code-make: $(MC)
+	-./$(MC) -s $(TARGET).c
+	-gcc $(TARGET).s $(MLIB)
+	-./a.out > $(TARGET).code-out
+
+test/code-gen-all.c: test/code-gen.pl test/code-gen.c
+	perl test/code-gen.pl < test/code-gen.c > test/code-gen-all.c
+
+tags:   tags-$(ARCH)
+
+tags-$(ARCH):  
+	ctags mc.h mc-code.h mc-code-$(ARCH).c  mc-codegen.c mc-codegen.h \
+		mc-parse.c mc-tree.c \
+	    conv/c.c conv/c.h \
+	    conv/conv.h conv/convdef.h 
+
+tar :
+	make clean
+	tar cBf - . | gzip > ../comp.tgz 
+
+depend :
+	makedepend mc-code-ia32.c mc-code.h mc-codegen.c mc-codegen.h \
+		mc-parse.c mc-tree.c mc-switch.c mc-switch.h mc.h \
+		mc-macro.c mc-macro.h mc-parse.h \
+	    conv/c.c conv/c.h conv/c2cbc.c conv/c2cbc.h conv/cbc2c.c \
+	    conv/cbc2c.h conv/conv.h conv/convdef.h conv/null.c conv/null.h \
+                mc-code-powerpc.c \
+                mc-code-mips.c
+
+clean :
+	-rm -f mc mc-ia32 mc-powerpc mc-mips *.bak *.s *.o *.cc mc mc1 mc2 a.out *~ core* */*.o *.bak test/*.s test/*.cc test/*.o test/*.bak test/*~ conv/*.s conv/*.cc conv/*.o conv/*.bak conv/*~ *.out */*.out *.i */*.i
+
+mc1 : b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o $(CONVERTER)
+	$(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o $(CONVERTER)
+
+mc2 : b00.s b01.s b02.s b03.s mc-macro.o  $(CONVERTER)
+	$(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s b04.s mc-macro.o $(CONVERTER)
+
+b00.s : mc-parse.c $(MC)
+	./$(MC) -s -ob00.s mc-parse.c
+b01.s : $(CODE) $(MC)
+	./$(MC) -s -ob01.s $(CODE)
+b02.s : mc-codegen.c $(MC)
+	./$(MC) -s -ob02.s mc-codegen.c
+b03.s : mc-tree.c $(MC)
+	./$(MC) -s -ob03.s mc-tree.c
+b04.s : mc-switch.c $(MC)
+	./$(MC) -s -ob04.s mc-switch.c
+
+b10.s : mc-parse.c mc1
+	./mc1 -s -ob10.s mc-parse.c
+b11.s : $(CODE) $(PRINTF) mc1
+	./mc1 -s -ob11.s $(CODE)
+b12.s : mc-codegen.c mc1
+	./mc1 -s -ob12.s mc-codegen.c
+b13.s : mc-tree.c mc1
+	./mc1 -s -ob13.s mc-tree.c
+b14.s : mc-switch.c mc1
+	./mc1 -s -ob14.s mc-switch.c
+
+b20.s : mc-parse.c mc2
+	./mc2 -s -ob20.s mc-parse.c
+b21.s : $(CODE) $(PRINTF) mc2
+	./mc2 -s -ob21.s $(CODE)
+b22.s : mc-codegen.c mc2
+	./mc2 -s -ob22.s mc-codegen.c
+b23.s : mc-tree.c mc2
+	./mc2 -s -ob23.s mc-tree.c
+b24.s : mc-switch.c mc1
+	./mc2 -s -ob24.s mc-switch.c
+
+diff :  b00.s b01.s b02.s b03.s b04.s b10.s b11.s b12.s b13.s b14.s
+	-diff b00.s b10.s
+	-diff b01.s b11.s
+	-diff b02.s b12.s
+	-diff b03.s b13.s
+	-diff b04.s b14.s
+
+diff2 :  b00.s b01.s b02.s b03.s b04.s b20.s b21.s b22.s b23.s b24.s
+	-diff b00.s b20.s
+	-diff b01.s b21.s
+	-diff b02.s b22.s
+	-diff b03.s b23.s
+	-diff b04.s b24.s
+
+
+# DO NOT DELETE
+
+mc-code-ia32.o: /usr/include/stdio.h /usr/include/features.h
+mc-code-ia32.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+mc-code-ia32.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stddef.h
+mc-code-ia32.o: /usr/include/bits/types.h /usr/include/bits/pthreadtypes.h
+mc-code-ia32.o: /usr/include/bits/sched.h /usr/include/libio.h
+mc-code-ia32.o: /usr/include/_G_config.h /usr/include/wchar.h
+mc-code-ia32.o: /usr/include/bits/wchar.h /usr/include/gconv.h
+mc-code-ia32.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stdarg.h
+mc-code-ia32.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/va-mips.h
+mc-code-ia32.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-codegen.h
+mc-code-ia32.o: mc-code.h
+mc-codegen.o: /usr/include/stdio.h /usr/include/features.h
+mc-codegen.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+mc-codegen.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stddef.h
+mc-codegen.o: /usr/include/bits/types.h /usr/include/bits/pthreadtypes.h
+mc-codegen.o: /usr/include/bits/sched.h /usr/include/libio.h
+mc-codegen.o: /usr/include/_G_config.h /usr/include/wchar.h
+mc-codegen.o: /usr/include/bits/wchar.h /usr/include/gconv.h
+mc-codegen.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stdarg.h
+mc-codegen.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/va-mips.h
+mc-codegen.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-codegen.h
+mc-codegen.o: mc-code.h
+mc-parse.o: /usr/include/stdio.h /usr/include/features.h
+mc-parse.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+mc-parse.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stddef.h
+mc-parse.o: /usr/include/bits/types.h /usr/include/bits/pthreadtypes.h
+mc-parse.o: /usr/include/bits/sched.h /usr/include/libio.h
+mc-parse.o: /usr/include/_G_config.h /usr/include/wchar.h
+mc-parse.o: /usr/include/bits/wchar.h /usr/include/gconv.h
+mc-parse.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stdarg.h
+mc-parse.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/va-mips.h
+mc-parse.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-codegen.h
+mc-parse.o: mc-switch.h mc-macro.h conv/conv.h
+mc-tree.o: /usr/include/stdio.h /usr/include/features.h
+mc-tree.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+mc-tree.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stddef.h
+mc-tree.o: /usr/include/bits/types.h /usr/include/bits/pthreadtypes.h
+mc-tree.o: /usr/include/bits/sched.h /usr/include/libio.h
+mc-tree.o: /usr/include/_G_config.h /usr/include/wchar.h
+mc-tree.o: /usr/include/bits/wchar.h /usr/include/gconv.h
+mc-tree.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stdarg.h
+mc-tree.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/va-mips.h
+mc-tree.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h
+mc-switch.o: /usr/include/stdio.h /usr/include/features.h
+mc-switch.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+mc-switch.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stddef.h
+mc-switch.o: /usr/include/bits/types.h /usr/include/bits/pthreadtypes.h
+mc-switch.o: /usr/include/bits/sched.h /usr/include/libio.h
+mc-switch.o: /usr/include/_G_config.h /usr/include/wchar.h
+mc-switch.o: /usr/include/bits/wchar.h /usr/include/gconv.h
+mc-switch.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stdarg.h
+mc-switch.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/va-mips.h
+mc-switch.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-codegen.h
+mc-switch.o: mc-code.h
+mc-macro.o: /usr/include/stdio.h /usr/include/features.h
+mc-macro.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+mc-macro.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stddef.h
+mc-macro.o: /usr/include/bits/types.h /usr/include/bits/pthreadtypes.h
+mc-macro.o: /usr/include/bits/sched.h /usr/include/libio.h
+mc-macro.o: /usr/include/_G_config.h /usr/include/wchar.h
+mc-macro.o: /usr/include/bits/wchar.h /usr/include/gconv.h
+mc-macro.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stdarg.h
+mc-macro.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/va-mips.h
+mc-macro.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-macro.h
+mc-macro.o: mc-code.h
+conv/c.o: /usr/include/stdio.h /usr/include/features.h
+conv/c.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+conv/c.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stddef.h
+conv/c.o: /usr/include/bits/types.h /usr/include/bits/pthreadtypes.h
+conv/c.o: /usr/include/bits/sched.h /usr/include/libio.h
+conv/c.o: /usr/include/_G_config.h /usr/include/wchar.h
+conv/c.o: /usr/include/bits/wchar.h /usr/include/gconv.h
+conv/c.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stdarg.h
+conv/c.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/va-mips.h
+conv/c.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h conv/conv.h
+conv/c.o: conv/convdef.h conv/c.h
+conv/c2cbc.o: mc.h
+conv/cbc2c.o: mc.h
+conv/null.o: /usr/include/stdio.h /usr/include/features.h
+conv/null.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+conv/null.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stddef.h
+conv/null.o: /usr/include/bits/types.h /usr/include/bits/pthreadtypes.h
+conv/null.o: /usr/include/bits/sched.h /usr/include/libio.h
+conv/null.o: /usr/include/_G_config.h /usr/include/wchar.h
+conv/null.o: /usr/include/bits/wchar.h /usr/include/gconv.h
+conv/null.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stdarg.h
+conv/null.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/va-mips.h
+conv/null.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h conv/conv.h
+conv/null.o: conv/convdef.h conv/null.h
+mc-code-powerpc.o: /usr/include/stdio.h /usr/include/features.h
+mc-code-powerpc.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+mc-code-powerpc.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stddef.h
+mc-code-powerpc.o: /usr/include/bits/types.h /usr/include/bits/pthreadtypes.h
+mc-code-powerpc.o: /usr/include/bits/sched.h /usr/include/libio.h
+mc-code-powerpc.o: /usr/include/_G_config.h /usr/include/wchar.h
+mc-code-powerpc.o: /usr/include/bits/wchar.h /usr/include/gconv.h
+mc-code-powerpc.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stdarg.h
+mc-code-powerpc.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/va-mips.h
+mc-code-powerpc.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-code.h
+mc-code-powerpc.o: mc-codegen.h
+mc-code-mips.o: /usr/include/stdio.h /usr/include/features.h
+mc-code-mips.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+mc-code-mips.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stddef.h
+mc-code-mips.o: /usr/include/bits/types.h /usr/include/bits/pthreadtypes.h
+mc-code-mips.o: /usr/include/bits/sched.h /usr/include/libio.h
+mc-code-mips.o: /usr/include/_G_config.h /usr/include/wchar.h
+mc-code-mips.o: /usr/include/bits/wchar.h /usr/include/gconv.h
+mc-code-mips.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/stdarg.h
+mc-code-mips.o: /usr/lib/gcc-lib/mipsEEel-linux/2.95.2/include/va-mips.h
+mc-code-mips.o: /usr/include/bits/stdio_lim.h mc.h mc-parse.h mc-code.h
+mc-code-mips.o: mc-codegen.h
--- a/mc-code-arm.c	Sun Oct 24 21:07:46 2004 +0900
+++ b/mc-code-arm.c	Mon Oct 25 01:16:28 2004 +0900
@@ -1949,6 +1949,7 @@
 	code_const(length,3);
         /* overrap must be allowed */
 	inc_inst(1);
+	// offset have to be ignored */
 	printf("\tbl\t%s\n",memmove);
 	extern_define(memmove,0,FUNCTION,1);
         fix=0;
--- a/mc-code-ia32.c	Sun Oct 24 21:07:46 2004 +0900
+++ b/mc-code-ia32.c	Mon Oct 25 01:16:28 2004 +0900
@@ -1114,13 +1114,6 @@
                 emit_copy(from,to,length,offset,0,det);
             break;
         }
-/*
-	if (det) {
-   call bcopy
-	    g_expr(list3(FUNCTION,,);
-	    break;
-	}
- */
 	use_register(from,REG_ESI,1);
 	use_register(to,  REG_EDI,1);
 	use_register(dreg,REG_ECX,0);
@@ -1135,8 +1128,6 @@
 	} else {
 	    printf("\tmovl $%d,%%ecx\n",length/4);
 	    fix = (length/4)*4;
-	    //if (offset)
-	    //	printf("\taddl $%d,%%edi\n",offset);
 	    printf("\tcld\n\trep\n\tmovsl\n");
 	    if(length%4) {
 		emit_copy(from,to,length,offset+length/SIZE_OF_INT,0,det);
--- a/mc-code-powerpc.c	Sun Oct 24 21:07:46 2004 +0900
+++ b/mc-code-powerpc.c	Mon Oct 25 01:16:28 2004 +0900
@@ -311,8 +311,8 @@
 	max_func_arg_label = 0;
     }
 
+#if 0
 printf("# reg_save %d\n",reg_save);
-#if 0
 printf("# function %s\n",fnptr->nm);
     l = ARG_LVAR_OFFSET;
 printf("# offset call0\t%d\n",CALLER_ARG);
@@ -1536,6 +1536,7 @@
 }
 
 #define MAX_COPY_LEN 20
+// #define MAX_COPY_LEN 10
 
 void
 
@@ -1594,10 +1595,7 @@
 	printf("\tli r5,%d\n",length>0?length:-length);
 	printf("\tmr r4,%s\n",frn);
 	printf("\tmr r3,%s\n",trn);
-	if (length<0 && offset) {
-	    code_add(4,offset,4);
-	    code_add(3,offset,3);
-	}
+	/* offset should be ignored */
         /* overrap must be allowed */
 	printf("\tbl L_%s$stub\n",memmove);
 	extern_define(memmove,0,FUNCTION,1);
@@ -2764,7 +2762,12 @@
 #endif
     printf("_%s:\n",name);
     code_disp_label=fwdlabel();
+#if 0
     printf("\tla r1,lo16(L_%d)(r30)\n",code_disp_label);
+#else
+    printf("\tla r1,lo16(L_%d)(r30)\n",code_disp_label);
+    printf("\taddis r1,r1,ha16(L_%d)\n",code_disp_label);
+#endif
     printf("\tbcl 20,31,L_%d\n",code_base = fwdlabel());
     fwddef(code_base);
     printf("\tmflr r31\n");
@@ -2785,9 +2788,13 @@
 {
     int r1_offsetv;
     disp&= -SIZE_OF_INT;
-    r1_offsetv = -disp+max_func_args*SIZE_OF_INT+code_disp_offset;
+    r1_offsetv = -disp+max_func_args*SIZE_OF_INT+code_disp_offset+8;
 
     printf(".set L_%d,%d\n",code_disp_label,-r1_offsetv);
+    if (max_func_arg_label) {
+	printf(".set L_%d,%d\n",max_func_arg_label,max_func_args*SIZE_OF_INT+24);
+	max_func_arg_label = 0;
+    }
     local_table();
     // free_all_register();
 }
--- a/mc-codegen.c	Sun Oct 24 21:07:46 2004 +0900
+++ b/mc-codegen.c	Mon Oct 25 01:16:28 2004 +0900
@@ -903,26 +903,26 @@
 {
     int e1;
     /*新しいレジスタ(or スタック)を取得する*/
-    if (scalar(ty) && sz==size_of_int && (e1=get_register())!=-1) {
-	e1=list3(REGISTER,e1,0);
+    if (scalar(ty) && sz==size_of_int && (e1=get_register_var(0))!=-1) {
+	// e1=list3(REGISTER,e1,0);
 	*use=list3(t,*use,e1);
 	g_expr_u(assign_expr0(e1,s,ty,ty));
 	*target = append4(*target,t,ty,e1);
 #if FLOAT_CODE
-    } else if (ty==DOUBLE && sz==size_of_double && (e1=get_dregister(1))!=-1) {
-	e1=list3(DREGISTER,e1,0);
+    } else if (ty==DOUBLE && sz==size_of_double && (e1=get_dregister_var(0,1))!=-1) {
+	// e1=list3(DREGISTER,e1,0);
 	*use=list3(t,*use,e1);
 	g_expr_u(assign_expr0(e1,s,ty,ty));
 	*target = append4(*target,t,ty,e1);
-    } else if (ty==FLOAT && sz==size_of_float && (e1=get_dregister(0))!=-1) {
-	e1=list3(FREGISTER,e1,0);
+    } else if (ty==FLOAT && sz==size_of_float && (e1=get_dregister_var(0,0))!=-1) {
+	// e1=list3(FREGISTER,e1,0);
 	*use=list3(t,*use,e1);
 	g_expr_u(assign_expr0(e1,s,ty,ty));
 	*target = append4(*target,t,ty,e1);
 #endif
 #if LONGLONG_CODE
-    } else if ((ty==LONGLONG||ty==ULONGLONG)&&(e1=get_lregister())!=-1) {
-	e1=list3(LREGISTER,e1,0);
+    } else if ((ty==LONGLONG||ty==ULONGLONG)&&(e1=get_lregister_var(0))!=-1) {
+	// e1=list3(LREGISTER,e1,0);
 	*use=list3(t,*use,e1);
 	g_expr_u(assign_expr0(e1,s,ty,ty));
 	*target = append4(*target,t,ty,e1);
@@ -1321,6 +1321,7 @@
     /* しかし、わかる場合もある */
     if (is_same_type(e2,e4)) {
 	if(cadr(e2)<cadr(e4)) { offset=sz; sz=-sz;}
+	else offset=0;
 	det=1;  
     } else {
 	det = 0;  offset=0;