diff options
author | Saurabh Verma <saurabh.verma@codito.com> | 2005-09-06 22:26:59 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2005-09-06 15:26:59 -0700 |
commit | 006fa7d4282bf2341c1c0e3162cc2cc70d3706e6 (patch) | |
tree | 3a05faf7b9080efca625adaf398cfa8d28c0dd32 | |
parent | 800dd123ee432ee01bbb515e30efccee505e39ac (diff) | |
download | gcc-006fa7d4282bf2341c1c0e3162cc2cc70d3706e6.zip gcc-006fa7d4282bf2341c1c0e3162cc2cc70d3706e6.tar.gz gcc-006fa7d4282bf2341c1c0e3162cc2cc70d3706e6.tar.bz2 |
re PR target/8972 ([arc-7-elf] the c code ' x << i' causes infinite loop when i = 0)
2005-09-06 Saurabh Verma <saurabh.verma@codito.com>
PR target/8972
* config/arc/arc.c (output_shift): Add check for loop count when
optimizing.
From-SVN: r103971
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/arc/arc.c | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c0eb165..96d6d60 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-09-06 Saurabh Verma <saurabh.verma@codito.com> + + PR target/8972 + * config/arc/arc.c (output_shift): Add check for loop count when + optimizing. + 2005-09-06 Steven Bosscher <stevenb@suse.de> * tree-ssa-phiopt.c (conditional_replacement): Construct proper SSA diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 2adf01d..6d8666e 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -1494,7 +1494,11 @@ output_shift (rtx *operands) if (GET_CODE (operands[2]) != CONST_INT) { if (optimize) - output_asm_insn ("mov lp_count,%2", operands); + { + output_asm_insn ("sub.f 0,%2,0", operands); + output_asm_insn ("mov lp_count,%2", operands); + output_asm_insn ("bz 2f", operands); + } else output_asm_insn ("mov %4,%2", operands); goto shiftloop; @@ -1568,6 +1572,8 @@ output_shift (rtx *operands) fprintf (asm_out_file, "1:\t%s single insn loop\n", ASM_COMMENT_START); output_asm_insn (shift_one, operands); + fprintf (asm_out_file, "2:\t%s end single insn loop\n", + ASM_COMMENT_START); } else { |