From 647d4b7512f3ecb46466e433adf975d01b810054 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 7 Mar 2012 14:30:38 +0000 Subject: [PATCH] c-typeck.c (pointer_diff): Use c_common_type_for_size. 2012-03-07 Richard Guenther * c-typeck.c (pointer_diff): Use c_common_type_for_size. From-SVN: r185047 --- gcc/ChangeLog | 4 ++++ gcc/c-typeck.c | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2a059a381f1f..38c1cf9c7614 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2012-03-07 Richard Guenther + + * c-typeck.c (pointer_diff): Use c_common_type_for_size. + 2012-03-07 Richard Guenther * convert.c (strip_float_extensions): Move ... diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 61bb8fd016ad..9891348029c1 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3413,8 +3413,7 @@ pointer_diff (location_t loc, tree op0, tree op1) be the same as the result type (ptrdiff_t), but may need to be a wider type if pointers for the address space are wider than ptrdiff_t. */ if (TYPE_PRECISION (restype) < TYPE_PRECISION (TREE_TYPE (op0))) - inttype = lang_hooks.types.type_for_size - (TYPE_PRECISION (TREE_TYPE (op0)), 0); + inttype = c_common_type_for_size (TYPE_PRECISION (TREE_TYPE (op0)), 0); else inttype = restype; -- 2.47.2