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]

Re: [PATCH] Fix PR66168: ICE due to incorrect invariant register info


On 05/20/2015 08:04 PM, Thomas Preud'homme wrote:
From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
owner@gcc.gnu.org] On Behalf Of Thomas Preud'homme
From: Steven Bosscher [mailto:stevenb.gcc@gmail.com]
Sent: Tuesday, May 19, 2015 7:21 PM

Not OK.
This will break in move_invariants() when it looks at REGNO (inv->reg).

Indeed. I'm even surprised all tests passed. Ok I will just prevent moving
in such a case. I'm running the tests now and will get back to you
tomorrow.

Patch is now tested via bootstrap + testsuite run on x86_64-linux-gnu and
building arm-none-eabi cross-compiler + testsuite run. Both testsuite run
show no regression.

diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 76a009f..4ce3576 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -1626,7 +1626,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))
Won't this run into into the same problem if DEST is a SUBREG?

Jeff




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]