OSDN Git Service

(decode_field_reference): Don't do anything for non-integral fields.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 May 1993 09:45:47 +0000 (09:45 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 May 1993 09:45:47 +0000 (09:45 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@4353 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fold-const.c

index 28a6a76..6570ac2 100644 (file)
@@ -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)