aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2004-06-08 22:03:29 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2004-06-08 15:03:29 -0700
commit908d0773f08485a63523e21520b948fe91998279 (patch)
treec1727a9e0f06951138cc4bd827ac892d789d154c /gcc/fold-const.c
parentd7777192b6d769f3a7312a8eb7856e0db41002d9 (diff)
downloadgcc-908d0773f08485a63523e21520b948fe91998279.zip
gcc-908d0773f08485a63523e21520b948fe91998279.tar.gz
gcc-908d0773f08485a63523e21520b948fe91998279.tar.bz2
fold-const.c (fold_convert): Treat OFFSET_TYPE like POINTER_TYPE and INTEGER_TYPE.
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
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 6eee710..b63f1c2 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -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)
{