From 80fffdef8fb97cc8e1774cfdaf2eabd07c9a7867 Mon Sep 17 00:00:00 2001 From: Ramana Radhakrishnan Date: Tue, 15 Mar 2011 16:14:21 +0000 Subject: [PATCH] re PR c++/47688 ([C++0x] Segfault when assigning lambda to std::function variable) Fix PR 47688 2011-03-18 Ramana Radhakrishnan PR target/47668 gcc/ * config/arm/arm.md (arm_movtas_ze): Use 'L' instead of 'c' in the output template. gcc/testsuite/ * gcc.target/arm/pr47688.c: New. From-SVN: r171000 --- gcc/ChangeLog | 6 ++++++ gcc/config/arm/arm.md | 4 +++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/arm/pr47688.c | 26 ++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/arm/pr47688.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d3f2eeffb7a..572309cdd89 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-03-15 Ramana Radhakrishnan + + PR target/47668 + * config/arm/arm.md (arm_movtas_ze): Use 'L' instead of 'c' + in the output template. + 2011-03-15 Richard Guenther PR middle-end/47650 diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 6f31e6211b4..b0f31f51934 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -10580,13 +10580,15 @@ [(set_attr "conds" "clob")] ) +;; We only care about the lower 16 bits of the constant +;; being inserted into the upper 16 bits of the register. (define_insn "*arm_movtas_ze" [(set (zero_extract:SI (match_operand:SI 0 "s_register_operand" "+r") (const_int 16) (const_int 16)) (match_operand:SI 1 "const_int_operand" ""))] "arm_arch_thumb2" - "movt%?\t%0, %c1" + "movt%?\t%0, %L1" [(set_attr "predicable" "yes") (set_attr "length" "4")] ) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 753f90045b6..28973660658 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-03-15 Ramana Radhakrishnan + + PR target/47688 + * gcc.target/arm/pr47688.c: New. + 2011-03-15 Richard Guenther PR middle-end/47650 diff --git a/gcc/testsuite/gcc.target/arm/pr47688.c b/gcc/testsuite/gcc.target/arm/pr47688.c new file mode 100644 index 00000000000..2236769461a --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr47688.c @@ -0,0 +1,26 @@ +/* { dg-options "-mthumb -O2" } */ +/* { dg-require-effective-target arm_thumb2_ok } */ +/* { dg-final { scan-assembler-not "-32768" } } */ + +typedef union +{ + unsigned long int u_32_value; + struct + { + unsigned short int u_16_value_0; + unsigned short int u_16_value_1; + } u_16_values; +} my_union; + + +unsigned long int Test(const unsigned short int wXe) +{ + my_union dwCalcVal; + + dwCalcVal.u_16_values.u_16_value_0=wXe; + dwCalcVal.u_16_values.u_16_value_1=0x8000u; + + dwCalcVal.u_32_value /=3; + + return (dwCalcVal.u_32_value); +} -- 2.30.2