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; }
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.
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
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.