0020-pr93402.diff 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. 2020-01-23 Jakub Jelinek <[email protected]>
  2. PR rtl-optimization/93402
  3. * postreload.c (reload_combine_recognize_pattern): Don't try to adjust
  4. USE insns.
  5. * gcc.c-torture/execute/pr93402.c: New test.
  6. --- a/gcc/postreload.c.jj 2020-01-12 11:54:36.000000000 +0100
  7. +++ b/gcc/postreload.c 2020-01-23 17:23:25.359929516 +0100
  8. @@ -1078,6 +1078,10 @@ reload_combine_recognize_pattern (rtx_in
  9. struct reg_use *use = reg_state[regno].reg_use + i;
  10. if (GET_MODE (*use->usep) != mode)
  11. return false;
  12. + /* Don't try to adjust (use (REGX)). */
  13. + if (GET_CODE (PATTERN (use->insn)) == USE
  14. + && &XEXP (PATTERN (use->insn), 0) == use->usep)
  15. + return false;
  16. }
  17. /* Look for (set (REGX) (CONST_INT))
  18. --- a/gcc/testsuite/gcc.c-torture/execute/pr93402.c.jj 2020-01-23 17:25:46.496803852 +0100
  19. +++ b/gcc/testsuite/gcc.c-torture/execute/pr93402.c 2020-01-23 17:25:05.221425501 +0100
  20. @@ -0,0 +1,21 @@
  21. +/* PR rtl-optimization/93402 */
  22. +
  23. +struct S { unsigned int a; unsigned long long b; };
  24. +
  25. +__attribute__((noipa)) struct S
  26. +foo (unsigned long long x)
  27. +{
  28. + struct S ret;
  29. + ret.a = 0;
  30. + ret.b = x * 11111111111ULL + 111111111111ULL;
  31. + return ret;
  32. +}
  33. +
  34. +int
  35. +main ()
  36. +{
  37. + struct S a = foo (1);
  38. + if (a.a != 0 || a.b != 122222222222ULL)
  39. + __builtin_abort ();
  40. + return 0;
  41. +}