diff --git a/gcc/lra.cc b/gcc/lra.cc index 8f30284e9da..8c6991751e5 100644 --- a/gcc/lra.cc +++ b/gcc/lra.cc @@ -1730,6 +1730,12 @@ lra_rtx_hash (rtx x) case CONST_INT: return val + UINTVAL (x); + case SUBREG: + val += lra_rtx_hash (SUBREG_REG (x)); + for (int i = 0; i < NUM_POLY_INT_COEFFS; ++i) + val += SUBREG_BYTE (x).coeffs[i]; + return val; + default: break; } diff --git a/gcc/testsuite/gcc.target/i386/pr119307.c b/gcc/testsuite/gcc.target/i386/pr119307.c new file mode 100644 index 00000000000..6b56f6b0ec1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr119307.c @@ -0,0 +1,14 @@ +/* PR rtl-optimization/119307 */ +/* { dg-do compile { target x32 } } */ +/* { dg-require-profiling "-fprofile-generate" } */ +/* { dg-options "-Os -maddress-mode=long -fprofile-generate -ftrapv" } */ + +_Complex int x; +__int128 y; +long n; + +void +foo (void) +{ + x *= *(__int128 *) __builtin_memmove (&y, &x, n); +}