Commit 006fa7d4 by Saurabh Verma Committed by Andrew Pinski

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
parent 800dd123
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> 2005-09-06 Steven Bosscher <stevenb@suse.de>
* tree-ssa-phiopt.c (conditional_replacement): Construct proper SSA * tree-ssa-phiopt.c (conditional_replacement): Construct proper SSA
......
...@@ -1494,7 +1494,11 @@ output_shift (rtx *operands) ...@@ -1494,7 +1494,11 @@ output_shift (rtx *operands)
if (GET_CODE (operands[2]) != CONST_INT) if (GET_CODE (operands[2]) != CONST_INT)
{ {
if (optimize) if (optimize)
{
output_asm_insn ("sub.f 0,%2,0", operands);
output_asm_insn ("mov lp_count,%2", operands); output_asm_insn ("mov lp_count,%2", operands);
output_asm_insn ("bz 2f", operands);
}
else else
output_asm_insn ("mov %4,%2", operands); output_asm_insn ("mov %4,%2", operands);
goto shiftloop; goto shiftloop;
...@@ -1568,6 +1572,8 @@ output_shift (rtx *operands) ...@@ -1568,6 +1572,8 @@ output_shift (rtx *operands)
fprintf (asm_out_file, "1:\t%s single insn loop\n", fprintf (asm_out_file, "1:\t%s single insn loop\n",
ASM_COMMENT_START); ASM_COMMENT_START);
output_asm_insn (shift_one, operands); output_asm_insn (shift_one, operands);
fprintf (asm_out_file, "2:\t%s end single insn loop\n",
ASM_COMMENT_START);
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment