From: Thomas Preud'homme Date: Thu, 28 May 2015 02:15:03 +0000 (+0000) Subject: Fix PR66168 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ddd93587efdd85681c3512bbfaa1988ea449d7dc;p=gcc.git Fix PR66168 From-SVN: r223795 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a4571f6352..74be3c707e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-05-28 Thomas Preud'homme + + PR rtl-optimization/66168 + * loop-invariant.c (move_invariant_reg): Pass dest rather than reg to + can_move_invariant_reg. + 2015-05-27 John David Anglin PR target/66148 diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c index 85270fe14bc..c4321292b5e 100644 --- a/gcc/loop-invariant.c +++ b/gcc/loop-invariant.c @@ -1630,7 +1630,7 @@ move_invariant_reg (struct loop *loop, unsigned invno) if (REG_P (reg)) regno = REGNO (reg); - if (!can_move_invariant_reg (loop, inv, reg)) + if (!can_move_invariant_reg (loop, inv, dest)) { reg = gen_reg_rtx_and_attrs (dest); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a1a242e3bb5..84b9fab017e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-05-28 Thomas Preud'homme + + PR rtl-optimization/66168 + * gcc.c-torture/compile/pr66168.c: New test. + 2015-05-27 Jeff Law PR target/39726 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr66168.c b/gcc/testsuite/gcc.c-torture/compile/pr66168.c new file mode 100644 index 00000000000..d6bfc7b44a6 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr66168.c @@ -0,0 +1,15 @@ +int a, b; + +void +fn1 () +{ + for (;;) + { + for (b = 0; b < 3; b++) + { + char e[2]; + char f = e[1]; + a ^= f ? 1 / f : 0; + } + } +}