diff --git a/gcc/regrename.cc b/gcc/regrename.cc index 10271e1b17d..f65135151d8 100644 --- a/gcc/regrename.cc +++ b/gcc/regrename.cc @@ -324,8 +324,7 @@ static bool check_new_reg_p (int reg ATTRIBUTE_UNUSED, int new_reg, class du_head *this_head, HARD_REG_SET this_unavailable) { - machine_mode mode = GET_MODE (*this_head->first->loc); - int nregs = hard_regno_nregs (new_reg, mode); + int nregs = this_head->nregs; int i; struct du_chain *tmp; diff --git a/gcc/testsuite/gcc.target/powerpc/pr105041.c b/gcc/testsuite/gcc.target/powerpc/pr105041.c new file mode 100644 index 00000000000..e5144b293a3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr105041.c @@ -0,0 +1,22 @@ +/* { dg-options "-mdejagnu-cpu=power4 -O2 -fcompare-debug -fharden-compares -frename-registers" } */ + +double m; +int n; + +unsigned int +foo (unsigned int x, int y) +{ + long long int a = y, b = !a; + int c = 0; + + if (b != x) + while ((int) m == a) + { + c = a; + a = 0; + } + + n = b = y; + + return x + c; +}