From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7845 invoked by alias); 16 Feb 2012 23:51:54 -0000 Received: (qmail 7829 invoked by uid 22791); 16 Feb 2012 23:51:52 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Feb 2012 23:51:37 +0000 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id B68481B4016; Thu, 16 Feb 2012 23:51:36 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: Re: [RFC] sim/sh: Fix compile warnings for 64-bit build hosts Date: Fri, 17 Feb 2012 01:21:00 -0000 User-Agent: KMail/1.13.7 (Linux/3.2.0; KDE/4.6.5; x86_64; ; ) Cc: Kevin Buettner References: <20120215172622.4f377c2b@mesquite.lan> <201202152350.35277.vapier@gentoo.org> <20120216163116.34dae543@mesquite.lan> In-Reply-To: <20120216163116.34dae543@mesquite.lan> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart8393086.og5Kzu6tpp"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201202161851.38810.vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00340.txt.bz2 --nextPart8393086.og5Kzu6tpp Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 1490 On Thursday 16 February 2012 18:31:16 Kevin Buettner wrote: > On Wed, 15 Feb 2012 23:50:34 -0500 Mike Frysinger wrote: > > On Wednesday 15 February 2012 19:26:22 Kevin Buettner wrote: > > > Any comments on the following patch? > >=20 > > uintptr_t i think would be better, but we don't seem to use that in sim= /, > > so this is OK > >=20 > > > It fixes a bunch of warnings when building on a 64-bit host. Here > > > are a few of them: > > >=20 > > > ./code.c:93: warning: cast from pointer to integer of different size > > > ./code.c:215: warning: cast from pointer to integer of different size > > > ./code.c:230: warning: cast from pointer to integer of different size > >=20 > > makes me think that this sim is incorrectly mixing target and host types >=20 > My reading of the code shows that (the variable behind) PC is char *. > (PC is a macro defined to be insn_ptr.) The MA macro needs to convert > that pointer to an int type in order to apply the mask. So I agree > that uintptr_t would be the right thing to use. >=20 > I've committed my patch, but if you wish I can try it with uintptr_t. > This will require us to include stdint.h. i don't think fixing this tiny issue would measurably improve the code, so= =20 don't worry about it. to truly make the code better, the PC would need to = not=20 be a pointer but rather uint32_t (for 32bit SuperH procs) and uin64_t (for= =20 64bit SuperH procs). and i imagine that is way more work than you want to= =20 take on ;). -mike --nextPart8393086.og5Kzu6tpp Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. Content-length: 836 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABAgAGBQJPPZaKAAoJEEFjO5/oN/WBNaEQAIAjfQEtqD1djsenM8TJreF9 16fUXSRSYvRL7t9cJ20nYeuhrgL4wwW0deIaZJDKqy2rED/sSMpvaAk36ipircVU SIEbeisGsyXh0q0ThONydlGWlnPIb0wyQ6dImmWc3BWm/zlDnWgA/1HMgzYgdtI8 ofcTRoDCizgALcXZdJNqbRNV3qQ+fUYCVO+Mdew932u2Rmio7TE0C0w0XEG9nJJz /uoJPLf9exzxMkksaEGY/g2HXZOVOnxvBYUYuSQ2QeVkweFofBFH+UW5CM4zVZdM KLA843dBHpUVL5YbpcLmlaI7jPQuwqWdUTQxc6RtuxBE9UHcrE0Zk4oH4VDxFe6u YYGU80NG4XnX1QgaGS2SrfTKsbJxJxXVzfDJwzkNEus01yel6cRoyxh4oUGCWeQQ tzjP7xX40NzHV6T5IN3mMmkK32K7Va8SGhrnh1db+Jzjwsh6JJsQPWZw2jYwUKqT pXevd+MobHZaa3c5RfRW6FvsDIuD+9v+QSBXSVQkqNYALxCy5WKS5Tucavx86slL GayS7RUhi78R/7rSjmLYVI2eW9VHf3toRIFCzH5TelzvxRrcfzIA2vjcu4Zk9zrJ AXENsX/4nBeoS4f7t+QFljcciahXTkE5lnODutQ4JcULqsMlHoDr9iiBr4irOhca AAIV9riVL9S6GCFB00sA =Dp3S -----END PGP SIGNATURE----- --nextPart8393086.og5Kzu6tpp--