931-avr32_disable_shifted_data_opt.patch 835 B

1234567891011121314151617181920212223242526272829303132
  1. --- a/gcc/config/avr32/avr32.c
  2. +++ b/gcc/config/avr32/avr32.c
  3. @@ -6726,7 +6726,28 @@ avr32_reorg_optimization (void)
  4. }
  5. }
  6. - if (TARGET_MD_REORG_OPTIMIZATION && (optimize_size || (optimize > 0)))
  7. + /* Disabled this optimization since it has a bug */
  8. + /* In the case where the data instruction the shifted insn gets folded
  9. + * into is a branch destination, this breaks, i.e.
  10. + *
  11. + * add r8, r10, r8 << 2
  12. + * 1:
  13. + * ld.w r11, r8[0]
  14. + * ...
  15. + * mov r8, sp
  16. + * rjmp 1b
  17. + *
  18. + * gets folded to:
  19. + *
  20. + * 1:
  21. + * ld.w r11, r10[r8 << 2]
  22. + * ...
  23. + * mov r8, sp
  24. + * rjmp 1b
  25. + *
  26. + * which is clearly wrong..
  27. + */
  28. + if (0 && TARGET_MD_REORG_OPTIMIZATION && (optimize_size || (optimize > 0)))
  29. {
  30. /* Scan through all insns looking for shifted add operations */