diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 96cd9d5722b..f5c7dfcc65e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2011-09-30 Ramana Radhakrishnan + + PR target/50099 + * config/arm/iterators.md (qhs_zextenddi_cstr): New. + (qhs_zextenddi_op): New. + * config/arm/arm.md ("zero_extenddi2"): Use them. + * config/arm/predicates.md ("arm_extendqisi_mem_op"): + Distinguish between ARM and Thumb2 states. + 2011-09-30 David S. Miller * config/sparc/sparc.opt (VIS2): New option. diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 3889322fd47..baa7eb41b4e 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -4389,8 +4389,8 @@ (define_insn "zero_extenddi2" [(set (match_operand:DI 0 "s_register_operand" "=r") - (zero_extend:DI (match_operand:QHSI 1 "" - "")))] + (zero_extend:DI (match_operand:QHSI 1 "" + "")))] "TARGET_32BIT " "#" [(set_attr "length" "8") diff --git a/gcc/config/arm/iterators.md b/gcc/config/arm/iterators.md index 219918c8064..da1f7af9b7a 100644 --- a/gcc/config/arm/iterators.md +++ b/gcc/config/arm/iterators.md @@ -390,10 +390,14 @@ (define_mode_attr qhs_zextenddi_cond [(SI "") (HI "&& arm_arch6") (QI "")]) (define_mode_attr qhs_sextenddi_cond [(SI "") (HI "&& arm_arch6") (QI "&& arm_arch6")]) -(define_mode_attr qhs_extenddi_op [(SI "s_register_operand") +(define_mode_attr qhs_zextenddi_op [(SI "s_register_operand") (HI "nonimmediate_operand") (QI "nonimmediate_operand")]) -(define_mode_attr qhs_extenddi_cstr [(SI "r") (HI "rm") (QI "rm")]) +(define_mode_attr qhs_extenddi_op [(SI "s_register_operand") + (HI "nonimmediate_operand") + (QI "arm_reg_or_extendqisi_mem_op")]) +(define_mode_attr qhs_extenddi_cstr [(SI "r") (HI "rm") (QI "rUq")]) +(define_mode_attr qhs_zextenddi_cstr [(SI "r") (HI "rm") (QI "rm")]) ;; Mode attributes used for fixed-point support. (define_mode_attr qaddsub_suf [(V4UQQ "8") (V2UHQ "16") (UQQ "8") (UHQ "16") diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md index 8b4a6773936..27ba6033f78 100644 --- a/gcc/config/arm/predicates.md +++ b/gcc/config/arm/predicates.md @@ -301,8 +301,11 @@ (define_special_predicate "arm_extendqisi_mem_op" (and (match_operand 0 "memory_operand") - (match_test "arm_legitimate_address_outer_p (mode, XEXP (op, 0), - SIGN_EXTEND, 0)"))) + (match_test "TARGET_ARM ? arm_legitimate_address_outer_p (mode, + XEXP (op, 0), + SIGN_EXTEND, + 0) + : memory_address_p (QImode, XEXP (op, 0))"))) (define_special_predicate "arm_reg_or_extendqisi_mem_op" (ior (match_operand 0 "arm_extendqisi_mem_op") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fa36dd08b63..1ad07775e24 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-09-30 Ramana Radhakrishnan + + * gcc.target/arm/pr50099.c: New test. + 2011-09-30 Matthew Gretton-Dann * gcc.target/arm/pr42835.c: Add -fno-tree-tail-merge. diff --git a/gcc/testsuite/gcc.target/arm/pr50099.c b/gcc/testsuite/gcc.target/arm/pr50099.c new file mode 100644 index 00000000000..c0d143dd578 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr50099.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +long long foo (signed char * arg) +{ + long long temp_1; + + temp_1 = arg[256]; + return temp_1; +}