This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/51821] [4.5/4.6/4.7 Regression] 64bit > 32bit conversion produces incorrect results with optimizations
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 11 Jan 2012 11:21:25 +0000
- Subject: [Bug c/51821] [4.5/4.6/4.7 Regression] 64bit > 32bit conversion produces incorrect results with optimizations
- Auto-submitted: auto-generated
- References: <bug-51821-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51821
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |i?86-*-*
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-01-11
Known to work| |4.4.6
Target Milestone|--- |4.5.4
Summary|64bit > 32bit conversion |[4.5/4.6/4.7 Regression]
|produces incorrect results |64bit > 32bit conversion
|with optimizations |produces incorrect results
| |with optimizations
Ever Confirmed|0 |1
Known to fail| |4.5.3, 4.6.2, 4.7.0
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-11 11:21:25 UTC ---
Confirmed. Reduced testcase:
extern void abort (void);
unsigned int __attribute__((noinline,noclone))
test(unsigned int shift_size)
{
unsigned long long res = 0;
res = ~res;
res = res << shift_size;
return res;
}
int
main()
{
unsigned int dst = sizeof (unsigned int) * 8;
if (test(dst) != 0)
abort ();
return 0;
}