Bug 35872 - [4.3 regression] incorrect code for 32bit multiplication by constant
Summary: [4.3 regression] incorrect code for 32bit multiplication by constant
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.3.0
: P3 major
Target Milestone: 4.3.1
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on: 35519
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-08 16:11 UTC by Andreas Kaiser
Modified: 2014-02-16 13:15 UTC (History)
3 users (show)

See Also:
Host: mingw
Target: avr
Build:
Known to work: 4.1.2 4.2.2
Known to fail: 4.3.0
Last reconfirmed: 2008-04-08 20:17:37


Attachments
testcase (96 bytes, text/plain)
2008-04-08 16:12 UTC, Andreas Kaiser
Details
assembly output for tiny25 (326 bytes, text/plain)
2008-04-08 16:12 UTC, Andreas Kaiser
Details
assembly output for mega16 (305 bytes, text/plain)
2008-04-08 16:13 UTC, Andreas Kaiser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kaiser 2008-04-08 16:11:32 UTC
A 32bit multiplication by a constant results in incorrect code when compiled for some AVR models (probably those having a hardware multiplier).

Command:
  avr-gcc -mmcu=attiny25 -Os -S t1.c      (correct)
  avr-gcc -mmcu=atmega16 -Os -S t1.c      (incorrect)
Comment 1 Andreas Kaiser 2008-04-08 16:12:08 UTC
Created attachment 15447 [details]
testcase
Comment 2 Andreas Kaiser 2008-04-08 16:12:32 UTC
Created attachment 15448 [details]
assembly output for tiny25
Comment 3 Andreas Kaiser 2008-04-08 16:13:01 UTC
Created attachment 15449 [details]
assembly output for mega16
Comment 4 Eric Weddington 2008-04-08 18:06:58 UTC
Works for 4.2.2 (WinAVR 20071221)
Comment 5 Eric Weddington 2008-04-08 18:16:03 UTC
Confirmed on WinAVR 20080407 (gcc 4.3.0 plus patches).
Comment 6 Eric Weddington 2008-04-08 20:38:27 UTC
Andy's combine.c patch for bug #35519 fixes this bug. This means that 4.3.0 is useless for the avr port until that patch is backported.
Comment 7 Andy Hutchinson 2008-04-12 15:28:07 UTC
Fixed 4.3 and 4.4
Comment 8 Jackie Rosen 2014-02-16 13:15:59 UTC Comment hidden (spam)