Bug 19059 - Atmel AVR Tiny13 and Tiny2313 support corrupted
Summary: Atmel AVR Tiny13 and Tiny2313 support corrupted
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P1 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-17 17:44 UTC by Frederik Rouleau
Modified: 2005-07-23 22:49 UTC (History)
2 users (show)

See Also:
Host: Any
Target: avr
Build: Any
Known to work:
Known to fail:
Last reconfirmed:


Attachments
workarround to fix the bug (906 bytes, patch)
2004-12-23 08:45 UTC, Frederik Rouleau
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederik Rouleau 2004-12-17 17:44:49 UTC
AtTiny13 and AtTiny2313 are considered as avr4 architecture. But they do not
support all the instructions of avr4.
For example the "mul" instruction does not exist. See bellow a test case for mul.

avr-gcc -mmcu=attiny2313 test_mul.c

int main(void) {
	uint8_t a, b;
	uint16_t res;
	res = a * b;
}
Comment 1 Frederik Rouleau 2004-12-23 08:45:49 UTC
Created attachment 7810 [details]
workarround to fix the bug

This patch moves attiny13 and attiny2313 from arch4 to arch2. Thus no bugs
occure anymore but the generated code is not optimized (lost movw, spm and some
form of lpm asm instructions).
A new architecture should be created to fully solve the problem.
Comment 2 GCC Commits 2004-12-25 22:20:11 UTC
Subject: Bug 19059

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	marekm@gcc.gnu.org	2004-12-25 22:20:05

Modified files:
	gcc            : ChangeLog 
	gcc/config/avr : avr.c avr.h t-avr 

Log message:
	PR target/19059
	* config/avr/avr.c (avr_mcu_types): Move attiny{13,2313} from avr4
	to avr2.
	* config/avr/avr.h (LINK_SPEC): Ditto.
	* config/avr/t-avr (MULTILIB_MATCHES): Ditto.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6954&r2=2.6955
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/avr/avr.c.diff?cvsroot=gcc&r1=1.124&r2=1.125
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/avr/avr.h.diff?cvsroot=gcc&r1=1.109&r2=1.110
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/avr/t-avr.diff?cvsroot=gcc&r1=1.13&r2=1.14

Comment 3 Andrew Pinski 2004-12-25 23:11:21 UTC
Fixed but who ever applied this patch, please note we are in regression only mode and that this patch 
should not have been applied unless you got special approval from Mark M.  Also note the patch which 
fixed has not been sent to gcc-patches@ yet but really should be as normal produces for gcc.