[Bug c/25332] New: 64 bit multiplication incorrectly folded.
/* * Compile -O0 (no optimization) */ #include typedef int int32; typedef long long int64; int main () { int32 i = 1;/* hence (2*i)-1 below is 1... */ #define K 0x80003LL /* 64 bit constant; low 32 are 3; high 32 are 8 */ printf("%016llx (gcc 2.96 bad: 0003)\n", K * ( (2*i) - 1 )); printf("%016llx (gcc 2.96 bad: 0003)\n", K * ( (2*i) - 1LL)); printf("%016llx (gcc 2.96 bad: 0003)\n", K * ( (2*i) - (int64)1 )); printf("%016llx (gcc 2.96 bad: fff80003)\n", K * ( (int64)(2*i) - 1 )); printf("%016llx (gcc 2.96 bad: fff80003)\n", K * ( (int64)(2*i) - 1LL)); printf("%016llx (gcc 2.96 bad: fff80003)\n", K * ( (int64)(2*i) - (int64)1 )); printf("%016llx (gcc 2.96 good: 00080003)\n", K * (2*(int64)( i) - 1 )); } -- Summary: 64 bit multiplication incorrectly folded. Product: gcc Version: 2.96 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jyates at netezza dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25332
[Bug c/25332] 64 bit multiplication incorrectly folded.
--- Comment #2 from jyates at netezza dot com 2005-12-09 22:42 --- Subject: RE: 64 bit multiplication incorrectly folded. Is it possible to determine what commit between 3.3.3 and 3.4.0 actually fixed the bug? I have a very strong motivation to see if I can propagate the fix back to the 2.96 code base. /john -Original Message- From: pinskia at gcc dot gnu dot org [mailto:[EMAIL PROTECTED] Sent: Friday, December 09, 2005 4:38 PM To: John Yates Subject: [Bug c/25332] 64 bit multiplication incorrectly folded. --- Comment #1 from pinskia at gcc dot gnu dot org 2005-12-09 21:37 --- Fixed in 3.4.0 and above, since 3.3.x and below are no longer being maintained closing as fixed. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Keywords||wrong-code Known to fail||3.3.3 3.2.3 3.0.4 Known to work||3.4.0 4.0.0 4.1.0 2.95.3 Resolution||FIXED Target Milestone|--- |3.4.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25332 --- You are receiving this mail because: --- You reported the bug, or are watching the reporter. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25332