Bug 44501 - Wrong register stored
Summary: Wrong register stored
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.3.2
: P3 normal
Target Milestone: ---
Assignee: Eric Weddington
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-11 13:23 UTC by Roland Caßebohm
Modified: 2017-01-07 12:29 UTC (History)
3 users (show)

See Also:
Host: i686-pc-cygwin
Target: avr32
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Test program (367 bytes, text/plain)
2010-06-11 13:27 UTC, Roland Caßebohm
Details
Listfile with resulted assembler (860 bytes, text/plain)
2010-06-11 13:29 UTC, Roland Caßebohm
Details
gcc output (791 bytes, text/plain)
2010-06-11 13:31 UTC, Roland Caßebohm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Caßebohm 2010-06-11 13:23:39 UTC
Hello,

it seems if there is a bug in the avr 32 gcc compiler.

avr32-gcc: version 4.3.2
toolchain: avr32-gnu-toolchain-2.4.2-setup.exe
avr32studio: avr32studio-ide-installer-2.5.0.35-win32.win32.x86.exe
Both got from www.atmel.com
Device: UC3B0256
Compilerflags: -O2 -g2 -mpart=uc3b0256

When compiling the atached example whith optimation "O2" the line:


telegramm[10] = 1;


won't be translated right.

In the listfile I see, that the wrong register will be stored to "telegramm[10]".


Listfile:

telegramm[10] = 1;
8000011a: 30 1a mov r10,1

void test_func(u8_t port)
{
u8_t *telegramm = test_str[port].telegramm_tx;

telegramm[6] = 33;
8000011c: b8 e9 st.b r12[0x6],r9

telegramm[10] = 1;
8000011e: f9 68 00 0a st.b r12[10],r8



It will store r8 instead of r10, which has got the 1.


I don't know if you coult help me, because the gcc ported from Atmel?


I have attached the test code, the listfile and the output of
avr32-gcc -v -save-temps -O2 -g3 -mpart=uc3b0256 -c main.o main.c.

(hope I can attach them after commit)
Comment 1 Roland Caßebohm 2010-06-11 13:27:44 UTC
Created attachment 20889 [details]
Test program

This file could be compiled alone with

avr32-gcc -v -save-temps -O2 -g3 -mpart=uc3b0256 -c main.o main.c
Comment 2 Roland Caßebohm 2010-06-11 13:29:40 UTC
Created attachment 20890 [details]
Listfile with resulted assembler

Generated with:
avr32-objdump.exe -S main.o > main.lst
Comment 3 Roland Caßebohm 2010-06-11 13:31:17 UTC
Created attachment 20891 [details]
gcc output

Output of avr32-gcc by using:
avr32-gcc -v -save-temps -O2 -g3 -mpart=uc3b0256 -c main.o main.c.
Comment 4 Georg-Johann Lay 2010-11-06 12:48:35 UTC
I think this bug should be closed.

It's about a private port from Atmel for AVR32 which is not in GCC main line.
Comment 5 Eric Weddington 2010-11-06 12:56:40 UTC
(In reply to comment #4)
> I think this bug should be closed.
> 
> It's about a private port from Atmel for AVR32 which is not in GCC main line.

I'm leaving it open for the moment. Assigning to self.
Comment 6 Georg-Johann Lay 2017-01-07 12:29:31 UTC
Closed as invalig because AVR32 is not a supported target.