aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-05-06 05:45:47 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-05-06 05:45:47 -0400
commit772ae9f018e47a61c32568babd238c4df4b8f521 (patch)
tree1197b1423157d5ca40182ea6de1065633155e624 /gcc
parent8e7e536500c31b0d3b8890d5aee90c9f644138da (diff)
downloadgcc-772ae9f018e47a61c32568babd238c4df4b8f521.zip
gcc-772ae9f018e47a61c32568babd238c4df4b8f521.tar.gz
gcc-772ae9f018e47a61c32568babd238c4df4b8f521.tar.bz2
(decode_field_reference): Don't do anything for non-integral fields.
From-SVN: r4353
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fold-const.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 28a6a76..6570ac2 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2418,6 +2418,12 @@ decode_field_reference (exp, pbitsize, pbitpos, pmode, punsignedp,
tree inner;
tree offset;
+ /* All the optimizations using this function assume integer fields.
+ There are problems with FP fields since the type_for_size call
+ below can fail for, e.g., XFmode. */
+ if (! INTEGRAL_TYPE_P (TREE_TYPE (exp)))
+ return 0;
+
STRIP_NOPS (exp);
if (TREE_CODE (exp) == BIT_AND_EXPR)