Commit 5b31bbab by Andrew Pinski Committed by Andrew Pinski

re PR rtl-optimization/37782 (Stage2 ada compiler miscompiled)

2008-11-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR rtl-opt/37782
        * loop-doloop.c (doloop_modify): Add from_mode argument that says what
        mode count is in.
        (doloop_optimize): Update call to doloop_modify.

From-SVN: r141558
parent 2d8d91a8
2008-11-03 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR rtl-opt/37782
* loop-doloop.c (doloop_modify): Add from_mode argument that says what
mode count is in.
(doloop_optimize): Update call to doloop_modify.
2008-11-03 Eric Botcazou <ebotcazou@adacore.com> 2008-11-03 Eric Botcazou <ebotcazou@adacore.com>
* tree-sra.c (bitfield_overlaps_p): Fix oversight. * tree-sra.c (bitfield_overlaps_p): Fix oversight.
......
...@@ -335,11 +335,12 @@ add_test (rtx cond, edge *e, basic_block dest) ...@@ -335,11 +335,12 @@ add_test (rtx cond, edge *e, basic_block dest)
end of the loop. CONDITION is the condition separated from the end of the loop. CONDITION is the condition separated from the
DOLOOP_SEQ. COUNT is the number of iterations of the LOOP. DOLOOP_SEQ. COUNT is the number of iterations of the LOOP.
ZERO_EXTEND_P says to zero extend COUNT after the increment of it to ZERO_EXTEND_P says to zero extend COUNT after the increment of it to
word_mode. */ word_mode from FROM_MODE. */
static void static void
doloop_modify (struct loop *loop, struct niter_desc *desc, doloop_modify (struct loop *loop, struct niter_desc *desc,
rtx doloop_seq, rtx condition, rtx count, bool zero_extend_p) rtx doloop_seq, rtx condition, rtx count,
bool zero_extend_p, enum machine_mode from_mode)
{ {
rtx counter_reg; rtx counter_reg;
rtx tmp, noloop = NULL_RTX; rtx tmp, noloop = NULL_RTX;
...@@ -413,11 +414,11 @@ doloop_modify (struct loop *loop, struct niter_desc *desc, ...@@ -413,11 +414,11 @@ doloop_modify (struct loop *loop, struct niter_desc *desc,
} }
if (increment_count) if (increment_count)
count = simplify_gen_binary (PLUS, mode, count, const1_rtx); count = simplify_gen_binary (PLUS, from_mode, count, const1_rtx);
if (zero_extend_p) if (zero_extend_p)
count = simplify_gen_unary (ZERO_EXTEND, word_mode, count = simplify_gen_unary (ZERO_EXTEND, word_mode,
count, mode); count, from_mode);
/* Insert initialization of the count register into the loop header. */ /* Insert initialization of the count register into the loop header. */
start_sequence (); start_sequence ();
...@@ -672,7 +673,8 @@ doloop_optimize (struct loop *loop) ...@@ -672,7 +673,8 @@ doloop_optimize (struct loop *loop)
return false; return false;
} }
doloop_modify (loop, desc, doloop_seq, condition, count, zero_extend_p); doloop_modify (loop, desc, doloop_seq, condition, count,
zero_extend_p, mode);
return true; return true;
} }
......
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