(decode_field_reference): Don't do anything for non-integral fields.
authorRichard Kenner <kenner@gcc.gnu.org>
Thu, 6 May 1993 09:45:47 +0000 (05:45 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 6 May 1993 09:45:47 +0000 (05:45 -0400)
From-SVN: r4353

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)