From patchwork Thu May 10 17:20:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4.7] Backport fix to [un]signed_type_for Date: Thu, 10 May 2012 07:20:37 -0000 From: William J. Schmidt X-Patchwork-Id: 158349 Message-Id: <1336670437.11473.38.camel@gnopaine> To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org, rguenther@suse.de, bergner@vnet.ibm.com On Thu, 2012-05-10 at 18:49 +0200, Jakub Jelinek wrote: > On Thu, May 10, 2012 at 11:44:27AM -0500, William J. Schmidt wrote: > > Backporting this patch to 4.7 fixes a problem building Fedora 17. > > Bootstrapped and regression tested on powerpc64-unknown-linux-gnu. Is > > the backport OK? > > For 4.7 I'd very much prefer a less intrusive change (i.e. change > the java langhook) instead, but I'll defer to Richard if he prefers > this over that. OK. If that's desired, this is the possible change to the langhook: which also fixed the problem and bootstraps without regressions. Whichever you guys prefer is fine with me. Thanks, Bill > > > 2012-05-10 Bill Schmidt > > > > Backport from trunk: > > 2012-03-12 Richard Guenther > > > > * tree.c (signed_or_unsigned_type_for): Use > > build_nonstandard_integer_type. > > (signed_type_for): Adjust documentation. > > (unsigned_type_for): Likewise. > > * tree-pretty-print.c (dump_generic_node): Use standard names > > for non-standard integer types if available. > > Jakub > Index: gcc/java/typeck.c =================================================================== --- gcc/java/typeck.c (revision 187158) +++ gcc/java/typeck.c (working copy) @@ -189,6 +189,12 @@ java_type_for_size (unsigned bits, int unsignedp) return unsignedp ? unsigned_int_type_node : int_type_node; if (bits <= TYPE_PRECISION (long_type_node)) return unsignedp ? unsigned_long_type_node : long_type_node; + /* A 64-bit target with TImode requires 128-bit type definitions + for bitsizetype. */ + if (int128_integer_type_node + && bits == TYPE_PRECISION (int128_integer_type_node)) + return (unsignedp ? int128_unsigned_type_node + : int128_integer_type_node); return 0; }