aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2011-06-01 19:49:53 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2011-06-01 19:49:53 +0000
commit02972eafb03f823c9dcbe3ede3d1f96562afaa89 (patch)
tree512555575631369514775396520cedb9467f1074 /gcc/expmed.c
parent4d41c2d1ce6f01c53eb8941461b3047e8a6368f6 (diff)
downloadgcc-02972eafb03f823c9dcbe3ede3d1f96562afaa89.zip
gcc-02972eafb03f823c9dcbe3ede3d1f96562afaa89.tar.gz
gcc-02972eafb03f823c9dcbe3ede3d1f96562afaa89.tar.bz2
re PR target/45074 (GCC Segmentation fault - negating global register variables)
gcc/ PR target/45074 * optabs.h (valid_multiword_target_p): Declare. * expmed.c (extract_bit_field_1): Check valid_multiword_target_p when doing multi-word operations. * optabs.c (expand_binop): Likewise. (expand_doubleword_bswap): Likewise. (expand_absneg_bit): Likewise. (expand_unop): Likewise. (expand_copysign_bit): Likewise. (multiword_target_p): New function. gcc/testsuite/ PR target/45074 * gcc.target/mips/pr45074.c: New test. From-SVN: r174541
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 5527c1e..314fac7 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -1341,7 +1341,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
unsigned int nwords = (bitsize + (BITS_PER_WORD - 1)) / BITS_PER_WORD;
unsigned int i;
- if (target == 0 || !REG_P (target))
+ if (target == 0 || !REG_P (target) || !valid_multiword_target_p (target))
target = gen_reg_rtx (mode);
/* Indicate for flow that the entire target reg is being set. */