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] |
Hi, For non-optimizing case, SH compiler sets the mode of a case vector element to HImode even if its value is too big for HImode. This prevents the bootstrap on mainline for sh-linux target. The 3.3 branch has the same problem. The attached patch fixes it and makes sh4-unknown-linux-gnu compiler bootstrap on mainline. There is one additional fail in regtest but it isn't a new regression as explained bellow. Ok for 3.3-branch and mainline? This fix reveals an another problem with -O0 by chance. I found that gcc.c-torture/compile/20001121-1.c failed with -O0 because compiler wrongly generates a short conditional branch which jumps to the label out of the short range -252..258 with a patched compiler. This fail occurs also with -O0 -mbigtable for the same testcase on the non-patched compiler. It seems that since shorten_branches does only a single pass for non-optimizing case, the expression (minus (match_dup 0) (pc)) in the definition of short_cbranch_p results a smaller value based on the maximal possible length of the conditional branch. In optimizing case, it isn't a problem since the recomputation in shorten_branches is done and the second try of (minus (match_dup 0) (pc)) returns the correct value. I guess that to recompute in shorten_branches always is the simplest solution though I'm unsure it's the right thing to do. Thought? Regards, kaz -- 2002-12-28 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (CASE_VECTOR_MODE): Use SImode for a non-optimizing compile. (ASM_OUTPUT_ADDR_VEC_ELT): Use .long for a non-optimizing compile. --- ORIG/gcc/gcc/config/sh/sh.h Tue Dec 17 07:06:35 2002 +++ LOCAL/gcc/gcc/config/sh/sh.h Thu Dec 27 14:59:10 2002 @@ -2571,7 +2571,7 @@ while (0) /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ -#define CASE_VECTOR_MODE (TARGET_BIGTABLE ? SImode : HImode) +#define CASE_VECTOR_MODE ((! optimize || TARGET_BIGTABLE) ? SImode : HImode) #define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY) \ ((MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 127 \ @@ -3041,7 +3041,7 @@ while (0) /* Output an absolute table element. */ #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE) \ - if (TARGET_BIGTABLE) \ + if (! optimize || TARGET_BIGTABLE) \ asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)); \ else \ asm_fprintf ((STREAM), "\t.word\t%LL%d\n", (VALUE));
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |