From: Richard Sandiford Date: Thu, 21 Apr 2011 09:39:03 +0000 (+0000) Subject: re PR target/46329 (ICE on ARM for __attribute__ ((vector_size (8 * sizeof(int))... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4b18d6830938102b414a736f44203792056b6f69;p=gcc.git re PR target/46329 (ICE on ARM for __attribute__ ((vector_size (8 * sizeof(int)))) operations) gcc/ PR target/46329 * config/arm/arm.c (arm_legitimate_constant_p_1): Return false for all Neon struct constants. gcc/testsuite/ 2011-04-04 Richard Earnshaw Richard Sandiford PR target/46329 * gcc.target/arm/pr46329.c: New test. From-SVN: r172815 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 95f931b7570..ec65ff12d95 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-04-21 Richard Sandiford + + PR target/46329 + * config/arm/arm.c (arm_legitimate_constant_p_1): Return false + for all Neon struct constants. + 2011-04-21 Richard Sandiford * target.def (legitimate_constant_p): New hook. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 97d2d6f47e5..175352e372c 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -6511,8 +6511,14 @@ arm_tls_referenced_p (rtx x) When generating pic allow anything. */ static bool -arm_legitimate_constant_p_1 (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x) +arm_legitimate_constant_p_1 (enum machine_mode mode, rtx x) { + /* At present, we have no support for Neon structure constants, so forbid + them here. It might be possible to handle simple cases like 0 and -1 + in future. */ + if (TARGET_NEON && VALID_NEON_STRUCT_MODE (mode)) + return false; + return flag_pic || !label_mentioned_p (x); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ae5daf2af53..56cc38a04da 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2011-04-21 Richard Earnshaw + Richard Sandiford + + PR target/46329 + * gcc.target/arm/pr46329.c: New test. + 2011-04-21 Tobias Burnus PR fortran/18918 diff --git a/gcc/testsuite/gcc.target/arm/pr46329.c b/gcc/testsuite/gcc.target/arm/pr46329.c new file mode 100644 index 00000000000..9dd939c7f93 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr46329.c @@ -0,0 +1,9 @@ +/* { dg-options "-O2" } */ +/* { dg-add-options arm_neon } */ + +int __attribute__ ((vector_size (32))) x; +void +foo (void) +{ + x <<= x; +}