aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 0cc80ad..ebd32bb 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -15489,6 +15489,8 @@ ptr_difference_const (tree e1, tree e2, poly_int64_pod *diff)
tree
convert_to_ptrofftype_loc (location_t loc, tree off)
{
+ if (ptrofftype_p (TREE_TYPE (off)))
+ return off;
return fold_convert_loc (loc, sizetype, off);
}