diff mbox

Use c_common_type_for_size from the C frontend

Message ID alpine.LNX.2.00.1203071356400.18230@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener March 7, 2012, 12:57 p.m. UTC
I'll apply this as obvious after including it in a bootstrap / regtest.

Richard.

2012-03-07  Richard Guenther  <rguenther@suse.de>

	* c-typeck.c (pointer_diff): Use c_common_type_for_size.
diff mbox

Patch

Index: gcc/c-typeck.c
===================================================================
--- gcc/c-typeck.c	(revision 185029)
+++ gcc/c-typeck.c	(working copy)
@@ -3413,8 +3410,7 @@  pointer_diff (location_t loc, tree op0,
      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;