{
if (fmt[i] == 'e')
{
- if (lra_substitute_pseudo (&XEXP (x, i), old_regno,
- new_reg, subreg_p, debug_p))
+ if (debug_p
+ && i == 0
+ && (code == SUBREG
+ || code == ZERO_EXTEND
+ || code == SIGN_EXTEND
+ || code == FLOAT
+ || code == UNSIGNED_FLOAT))
+ {
+ rtx y = XEXP (x, 0);
+ if (lra_substitute_pseudo (&y, old_regno,
+ new_reg, subreg_p, debug_p))
+ {
+ result = true;
+ if (CONST_SCALAR_INT_P (y))
+ {
+ if (code == SUBREG)
+ y = simplify_subreg (GET_MODE (x), y,
+ GET_MODE (SUBREG_REG (x)),
+ SUBREG_BYTE (x));
+ else
+ y = simplify_unary_operation (code, GET_MODE (x), y,
+ GET_MODE (XEXP (x, 0)));
+ if (y)
+ *loc = y;
+ else
+ *loc = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
+ }
+ else
+ XEXP (x, 0) = y;
+ }
+ }
+ else if (lra_substitute_pseudo (&XEXP (x, i), old_regno,
+ new_reg, subreg_p, debug_p))
result = true;
}
else if (fmt[i] == 'E')
--- /dev/null
+/* PR debug/104778 */
+/* { dg-do compile } */
+/* { dg-options "-mcmpb -Og -g" } */
+/* { dg-additional-options "-fpie" { target pie } } */
+
+unsigned long long int p;
+short int m, n;
+
+void
+foo (double u, int v, int x, int y, int z)
+{
+ long long int a = v;
+ short int b = v;
+ int c = 0, d = m, e = u;
+
+ if (n)
+ {
+ int q = b;
+
+ while (p / 1.0)
+ c = 0;
+
+ if (n * n == (d + 1) / (1LL << x))
+ a = 1;
+
+ b = u;
+ while (d)
+ {
+ u = m + 1ULL;
+ b = a - (unsigned long long int) u + a + (char) (u + 1.0);
+ d = (v - 1LL) * n / d + q + x;
+ q = m;
+ }
+ }
+
+ while (c < 1)
+ {
+ int r;
+
+ if (m == y)
+ m = e * z;
+
+ e = !a;
+
+ while (!r)
+ ;
+
+ if (b)
+ m = d;
+ }
+}