Bug 36845 - The compiler fails to build the support libraries and generates incorrect code for a target
Summary: The compiler fails to build the support libraries and generates incorrect cod...
Status: RESOLVED DUPLICATE of bug 35073
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.3.1
: P3 major
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-15 23:05 UTC by Zoltan Kocsi
Modified: 2008-07-19 13:05 UTC (History)
7 users (show)

See Also:
Host: x86-linux-elf
Target: avr-unknown-elf
Build: x86-linux-elf
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zoltan Kocsi 2008-07-15 23:05:18 UTC
With multilib enabled when building libgcc for avr35, the compiler generates instructions that are illegal on that target (movw) and fails, failing the whole installation process.

To reproduce the bug:

$ ../gcc-4.3.1/configure --target=avr-elf --disable-libada --disable-libssp --enable-languages=c
$ make

... lots of output, then, when compiling _mulsi3:

../../../../gcc-4.3.1/libgcc/../gcc/config/avr/libgcc.S: Assembler messages:
../../../../gcc-4.3.1/libgcc/../gcc/config/avr/libgcc.S:281: Error: illegal opcode movw for mcu avr3
../../../../gcc-4.3.1/libgcc/../gcc/config/avr/libgcc.S:283: Error: illegal opcode movw for mcu avr3
make[4]: *** [_mulsi3.o] Error 1

and the build process stops.

Quick tests show that the generated crosscompiler avoids movw when compiling to avr3 but generates it when compiling for avr35. The following function can be used to demonstrate it:

int foo( int a, int *p ) { return a + *p; }

and then:

$ xgcc -O3 -mmcu=avr35 -c foo.c
/tmp/cc0IiYn4.s: Assembler messages:
/tmp/cc0IiYn4.s:15: Error: illegal opcode movw for mcu avr3
/tmp/cc0IiYn4.s:20: Error: illegal opcode movw for mcu avr3
Comment 1 Wouter van Gulik 2008-07-18 22:31:00 UTC
This is because binutils 2.18 does not support architecture 35. Please update to 2.18.5 (dev snapshot) ftp://sourceware.org/pub/binutils/snapshots. Search the avr-gcc list for more info.
Comment 2 Eric Weddington 2008-07-19 13:05:43 UTC

*** This bug has been marked as a duplicate of 35073 ***