fold-const.c (fold_convert): Treat OFFSET_TYPE like POINTER_TYPE and INTEGER_TYPE.
authorAndrew Pinski <pinskia@physics.uc.edu>
Tue, 8 Jun 2004 22:03:29 +0000 (22:03 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Tue, 8 Jun 2004 22:03:29 +0000 (15:03 -0700)
2004-06-08  Andrew Pinski  <pinskia@physics.uc.edu>

        * fold-const.c (fold_convert): Treat OFFSET_TYPE like
        POINTER_TYPE and INTEGER_TYPE.

From-SVN: r82792

gcc/ChangeLog
gcc/fold-const.c

index b1798bc2c0dba81e37f87314f1cac62d0b592e4b..0edcc7af4f2aac0826c4b45fd8033cdf5a2ef5ee 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-08  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       * fold-const.c (fold_convert): Treat OFFSET_TYPE like
+       POINTER_TYPE and INTEGER_TYPE.
+
 2004-06-08  Bernardo Innocenti  <bernie@develer.com>
 
        * modulo-sched.c: Compile only when INSN_SCHEDULING is
index 6eee71016585eb5c54d886e936e25945eb20024f..b63f1c236717b2233206cf7ac6ed33bd57820acf 100644 (file)
@@ -1911,7 +1911,8 @@ fold_convert (tree type, tree arg)
   if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (orig))
     return fold (build1 (NOP_EXPR, type, arg));
 
-  if (INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type))
+  if (INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type)
+      || TREE_CODE (type) == OFFSET_TYPE)
     {
       if (TREE_CODE (arg) == INTEGER_CST)
        {
@@ -1919,7 +1920,8 @@ fold_convert (tree type, tree arg)
          if (tem != NULL_TREE)
            return tem;
        }
-      if (INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig))
+      if (INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig)
+         || TREE_CODE (orig) == OFFSET_TYPE)
         return fold (build1 (NOP_EXPR, type, arg));
       if (TREE_CODE (orig) == COMPLEX_TYPE)
        {