999-4.3.2-arm-fix-for-bug-37436.patch 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. gcc svn 142778:
  2. PR target/37436
  3. * arm.c (arm_legitimate_index): Only accept addresses that are in
  4. canonical form.
  5. * predicates.md (arm_reg_or_extendqisi_mem_op): New predicate.
  6. * arm.md (extendqihi2): Use arm_reg_or_extendqisi_mem_op predicate
  7. for operand1.
  8. (extendqisi2): Likewise.
  9. (arm_extendqisi, arm_extendqisi_v6): Use arm_extendqisi_mem_op
  10. predicate for operand1.
  11. diff -Nura gcc-4.3.3.orig/gcc/config/arm/arm.c gcc-4.3.3/gcc/config/arm/arm.c
  12. --- gcc-4.3.3.orig/gcc/config/arm/arm.c 2008-06-11 07:52:55.000000000 -0300
  13. +++ gcc-4.3.3/gcc/config/arm/arm.c 2009-05-21 16:06:45.000000000 -0300
  14. @@ -3769,6 +3769,7 @@
  15. rtx xop1 = XEXP (x, 1);
  16. return ((arm_address_register_rtx_p (xop0, strict_p)
  17. + && GET_CODE(xop1) == CONST_INT
  18. && arm_legitimate_index_p (mode, xop1, outer, strict_p))
  19. || (arm_address_register_rtx_p (xop1, strict_p)
  20. && arm_legitimate_index_p (mode, xop0, outer, strict_p)));
  21. diff -Nura gcc-4.3.3.orig/gcc/config/arm/arm.md gcc-4.3.3/gcc/config/arm/arm.md
  22. --- gcc-4.3.3.orig/gcc/config/arm/arm.md 2007-09-04 01:44:47.000000000 -0300
  23. +++ gcc-4.3.3/gcc/config/arm/arm.md 2009-05-21 16:06:45.000000000 -0300
  24. @@ -4199,7 +4199,7 @@
  25. (define_expand "extendqihi2"
  26. [(set (match_dup 2)
  27. - (ashift:SI (match_operand:QI 1 "general_operand" "")
  28. + (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
  29. (const_int 24)))
  30. (set (match_operand:HI 0 "s_register_operand" "")
  31. (ashiftrt:SI (match_dup 2)
  32. @@ -4224,7 +4224,7 @@
  33. (define_insn "*arm_extendqihi_insn"
  34. [(set (match_operand:HI 0 "s_register_operand" "=r")
  35. - (sign_extend:HI (match_operand:QI 1 "memory_operand" "Uq")))]
  36. + (sign_extend:HI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
  37. "TARGET_ARM && arm_arch4"
  38. "ldr%(sb%)\\t%0, %1"
  39. [(set_attr "type" "load_byte")
  40. @@ -4235,7 +4235,7 @@
  41. (define_expand "extendqisi2"
  42. [(set (match_dup 2)
  43. - (ashift:SI (match_operand:QI 1 "general_operand" "")
  44. + (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
  45. (const_int 24)))
  46. (set (match_operand:SI 0 "s_register_operand" "")
  47. (ashiftrt:SI (match_dup 2)
  48. @@ -4267,7 +4267,7 @@
  49. (define_insn "*arm_extendqisi"
  50. [(set (match_operand:SI 0 "s_register_operand" "=r")
  51. - (sign_extend:SI (match_operand:QI 1 "memory_operand" "Uq")))]
  52. + (sign_extend:SI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
  53. "TARGET_ARM && arm_arch4 && !arm_arch6"
  54. "ldr%(sb%)\\t%0, %1"
  55. [(set_attr "type" "load_byte")
  56. @@ -4278,7 +4278,8 @@
  57. (define_insn "*arm_extendqisi_v6"
  58. [(set (match_operand:SI 0 "s_register_operand" "=r,r")
  59. - (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,Uq")))]
  60. + (sign_extend:SI
  61. + (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "r,Uq")))]
  62. "TARGET_ARM && arm_arch6"
  63. "@
  64. sxtb%?\\t%0, %1
  65. diff -Nura gcc-4.3.3.orig/gcc/config/arm/predicates.md gcc-4.3.3/gcc/config/arm/predicates.md
  66. --- gcc-4.3.3.orig/gcc/config/arm/predicates.md 2007-08-02 07:49:31.000000000 -0300
  67. +++ gcc-4.3.3/gcc/config/arm/predicates.md 2009-05-21 16:06:45.000000000 -0300
  68. @@ -234,6 +234,10 @@
  69. (match_test "arm_legitimate_address_p (mode, XEXP (op, 0), SIGN_EXTEND,
  70. 0)")))
  71. +(define_special_predicate "arm_reg_or_extendqisi_mem_op"
  72. + (ior (match_operand 0 "arm_extendqisi_mem_op")
  73. + (match_operand 0 "s_register_operand")))
  74. +
  75. (define_predicate "power_of_two_operand"
  76. (match_code "const_int")
  77. {