This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/31679] Incorrect result of multiplication long long by 0xFFFFFFFFLL constant.
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Apr 2007 14:17:21 -0000
- Subject: [Bug target/31679] Incorrect result of multiplication long long by 0xFFFFFFFFLL constant.
- References: <bug-31679-14450@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from rguenth at gcc dot gnu dot org 2007-04-24 15:17 -------
I can reproduce this on i?86 with 32bit HWI (even with optimization if you
trick around CCP):
int one(void) { return 1; }
int printf (const char *, ...);
int main()
{
long long qhat = one();
long long res = qhat * 0xffffffffLL;
printf("res = %llx\n", res);
return 0;
}
But only with 4.1.1, at least gcc (GCC) 4.1.3 20070413 and
gcc (GCC) 4.1.2 20061115 (prerelease) are ok. Also
some gcc (GCC) 4.1.0 (SUSE Linux) is ok.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
GCC build triplet|i686-pc-cygwin |
GCC host triplet|i686-pc-cygwin |
GCC target triplet|i686-pc-cygwin |i686-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31679