Mercurial > hg > CbC > old > device
changeset 836:a760656224fa
parse mode diff is not worked yet...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 03 Dec 2010 20:37:01 +0900 |
parents | 59ebc5cb2a99 |
children | 672209eab3b9 |
files | Makefile Makefile.i64 mc-codegen.c |
diffstat | 3 files changed, 43 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Fri Dec 03 20:21:28 2010 +0900 +++ b/Makefile Fri Dec 03 20:37:01 2010 +0900 @@ -1,8 +1,8 @@ GCC = gcc CC = $(GCC) -std=c99 $(CCEXT) $(M) -fgnu89-inline # -O3 -# MCFLAGS = -DUSE_CODE_KEYWORD -CFLAGS = -g -Wall -I. $(MCFLAGS) # -O +# MCFLAG = -DUSE_CODE_KEYWORD +CFLAGS = -g -Wall -I. $(MCFLAG) # -O # CFLAGS = -g -Wall -I. -pg -fprofile-arcs -ftest-coverage # LDFLAGS = -pg # for Linux Zaurus @@ -240,37 +240,37 @@ $(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s b04.s mc-macro.o mc-inline.o $(CONVERTER) b00.s : mc-parse.c $(MC) - ./$(MC) $(MCFLAGS) -s -ob00.s mc-parse.c + ./$(MC) $(MCFLAG) -s -ob00.s mc-parse.c b01.s : $(CODE) $(MC) - ./$(MC) $(MCFLAGS) -s -ob01.s $(CODE) + ./$(MC) $(MCFLAG) -s -ob01.s $(CODE) b02.s : mc-codegen.c $(MC) - ./$(MC) $(MCFLAGS) -s -ob02.s mc-codegen.c + ./$(MC) $(MCFLAG) -s -ob02.s mc-codegen.c b03.s : mc-tree.c $(MC) - ./$(MC) $(MCFLAGS) -s -ob03.s mc-tree.c + ./$(MC) $(MCFLAG) -s -ob03.s mc-tree.c b04.s : mc-switch.c $(MC) - ./$(MC) $(MCFLAGS) -s -ob04.s mc-switch.c + ./$(MC) $(MCFLAG) -s -ob04.s mc-switch.c b10.s : mc-parse.c mc1 - ./mc1 $(MCFLAGS) -s -ob10.s mc-parse.c + ./mc1 $(MCFLAG) -s -ob10.s mc-parse.c b11.s : $(CODE) $(PRINTF) mc1 - ./mc1 $(MCFLAGS) -s -ob11.s $(CODE) + ./mc1 $(MCFLAG) -s -ob11.s $(CODE) b12.s : mc-codegen.c mc1 - ./mc1 $(MCFLAGS) -s -ob12.s mc-codegen.c + ./mc1 $(MCFLAG) -s -ob12.s mc-codegen.c b13.s : mc-tree.c mc1 - ./mc1 $(MCFLAGS) -s -ob13.s mc-tree.c + ./mc1 $(MCFLAG) -s -ob13.s mc-tree.c b14.s : mc-switch.c mc1 - ./mc1 $(MCFLAGS) -s -ob14.s mc-switch.c + ./mc1 $(MCFLAG) -s -ob14.s mc-switch.c b20.s : mc-parse.c mc2 - ./mc2 $(MCFLAGS) -s -ob20.s mc-parse.c + ./mc2 $(MCFLAG) -s -ob20.s mc-parse.c b21.s : $(CODE) $(PRINTF) mc2 - ./mc2 $(MCFLAGS) -s -ob21.s $(CODE) + ./mc2 $(MCFLAG) -s -ob21.s $(CODE) b22.s : mc-codegen.c mc2 - ./mc2 $(MCFLAGS) -s -ob22.s mc-codegen.c + ./mc2 $(MCFLAG) -s -ob22.s mc-codegen.c b23.s : mc-tree.c mc2 - ./mc2 $(MCFLAGS) -s -ob23.s mc-tree.c + ./mc2 $(MCFLAG) -s -ob23.s mc-tree.c b24.s : mc-switch.c mc1 - ./mc2 $(MCFLAGS) -s -ob24.s mc-switch.c + ./mc2 $(MCFLAG) -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
--- a/Makefile.i64 Fri Dec 03 20:21:28 2010 +0900 +++ b/Makefile.i64 Fri Dec 03 20:37:01 2010 +0900 @@ -1,8 +1,8 @@ GCC = gcc CC = $(GCC) -std=c99 $(CCEXT) $(M) -fgnu89-inline # -O3 -# MCFLAGS = -DUSE_CODE_KEYWORD -CFLAGS = -g -Wall -I. $(MCFLAGS) # -O +# MCFLAG = -DUSE_CODE_KEYWORD +CFLAGS = -g -Wall -I. $(MCFLAG) # -O # CFLAGS = -g -Wall -I. -pg -fprofile-arcs -ftest-coverage # LDFLAGS = -pg # for Linux Zaurus @@ -12,7 +12,7 @@ STAGE=1 MFLAGS=$(MFALGS) BASE=$(BASE) STAGE=$(STAGE) ARCH=i64 -MC=mc-$(ARCH) +MC=mc-$(ARCH) MLIB = -lm PRINTF= # printf.c CONVERTER=conv/c.o conv/null.o conv/c2cbc.o conv/cbc2c.o @@ -240,37 +240,37 @@ $(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s b04.s mc-macro.o mc-inline.o $(CONVERTER) b00.s : mc-parse.c $(MC) - ./$(MC) $(MCFLAGS) -s -ob00.s mc-parse.c + ./$(MC) $(MCFLAG) -s -ob00.s mc-parse.c b01.s : $(CODE) $(MC) - ./$(MC) $(MCFLAGS) -s -ob01.s $(CODE) + ./$(MC) $(MCFLAG) -s -ob01.s $(CODE) b02.s : mc-codegen.c $(MC) - ./$(MC) $(MCFLAGS) -s -ob02.s mc-codegen.c + ./$(MC) $(MCFLAG) -s -ob02.s mc-codegen.c b03.s : mc-tree.c $(MC) - ./$(MC) $(MCFLAGS) -s -ob03.s mc-tree.c + ./$(MC) $(MCFLAG) -s -ob03.s mc-tree.c b04.s : mc-switch.c $(MC) - ./$(MC) $(MCFLAGS) -s -ob04.s mc-switch.c + ./$(MC) $(MCFLAG) -s -ob04.s mc-switch.c b10.s : mc-parse.c mc1 - ./mc1 $(MCFLAGS) -s -ob10.s mc-parse.c + ./mc1 $(MCFLAG) -s -ob10.s mc-parse.c b11.s : $(CODE) $(PRINTF) mc1 - ./mc1 $(MCFLAGS) -s -ob11.s $(CODE) + ./mc1 $(MCFLAG) -s -ob11.s $(CODE) b12.s : mc-codegen.c mc1 - ./mc1 $(MCFLAGS) -s -ob12.s mc-codegen.c + ./mc1 $(MCFLAG) -s -ob12.s mc-codegen.c b13.s : mc-tree.c mc1 - ./mc1 $(MCFLAGS) -s -ob13.s mc-tree.c + ./mc1 $(MCFLAG) -s -ob13.s mc-tree.c b14.s : mc-switch.c mc1 - ./mc1 $(MCFLAGS) -s -ob14.s mc-switch.c + ./mc1 $(MCFLAG) -s -ob14.s mc-switch.c b20.s : mc-parse.c mc2 - ./mc2 $(MCFLAGS) -s -ob20.s mc-parse.c + ./mc2 $(MCFLAG) -s -ob20.s mc-parse.c b21.s : $(CODE) $(PRINTF) mc2 - ./mc2 $(MCFLAGS) -s -ob21.s $(CODE) + ./mc2 $(MCFLAG) -s -ob21.s $(CODE) b22.s : mc-codegen.c mc2 - ./mc2 $(MCFLAGS) -s -ob22.s mc-codegen.c + ./mc2 $(MCFLAG) -s -ob22.s mc-codegen.c b23.s : mc-tree.c mc2 - ./mc2 $(MCFLAGS) -s -ob23.s mc-tree.c + ./mc2 $(MCFLAG) -s -ob23.s mc-tree.c b24.s : mc-switch.c mc1 - ./mc2 $(MCFLAGS) -s -ob24.s mc-switch.c + ./mc2 $(MCFLAG) -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
--- a/mc-codegen.c Fri Dec 03 20:21:28 2010 +0900 +++ b/mc-codegen.c Fri Dec 03 20:37:01 2010 +0900 @@ -4590,7 +4590,11 @@ // bitfield will be checked after parse return e1; } - if (car(e)==INDIRECT) e = cadr(e); + ind = 0; + if (car(e)==INDIRECT) { + e = cadr(e); + ind = 1; + } if(dsp) { switch(OP(car(e))) { case GVAR: @@ -4613,6 +4617,9 @@ e=list3(ADD,e,list2(CONST,dsp)); } } + if (ind && !parse_mode && !inmode) { + e = list2(INDIRECT,e); + } type0 = type_value(type); if (type>0&&car(type)==BIT_FIELD) { // n->ty = list4(BIT_FIELD,type,bit_offset, bit_size);