avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] Compiler error


From: Larry Barello
Subject: RE: [avr-gcc-list] Compiler error
Date: Sun, 29 May 2005 20:14:37 -0700

Ok, I submitted this as a bug (#21811) and within an hour it was closed as a
duplicate of #8788 which will be corrected in the 4.1.0 mainline.  #8788
sounds similar, but I am still somewhat unsatisfied since a union of a three
byte array and a word should be allowed in C.  Maybe I just didn't
understand.

-----Original Message-----
From: Haase Bjoern (PT-BEU/EMT) * [mailto:address@hidden
Sent: Monday, May 23, 2005 7:31 AM
To: Larry Barello; Joerg Wunsch; address@hidden
Subject: AW: [avr-gcc-list] Compiler error


I was able to reproduce your problem.
I assume that the underlying problem is, that gcc does assign the mode
BLKmode to your 3-Byte objects. It crashes since it does not know how to
place an object of mode BLKmode into registers: Blockmode is meant to be
used for memory blocks but also assigned to structs/unions of sizes that do
not exactly fit into int, long int or long long int variables.
Your asm code is forcing a BLKmode object into registers by using the "r"
constraint and there's the problem: GCC does not know how to place blocks of
memory into registers.
E.g. have a look how your object would be returned or passed as a function
parameter: GCC would probably never pass or return your union in registers
but allways in memory.

It's also not a problem of the avr port alone. The x86 port crashes as well
with your source code.

Short term (but shurly not most efficient) workaround would be to allocate 4
bytes for your union. In this case gcc will allocate a variable of mode
SImode and for this type of object, gcc knows how to place SImode objects
into registers. Other workaround would be to leave your object in memory.

HTH,

Björn

-----Urspr√ľngliche Nachricht-----
Von: address@hidden
[mailto:address@hidden Im
Auftrag von Larry Barello
Gesendet: Montag, 23. Mai 2005 16:04
An: Joerg Wunsch; address@hidden
Betreff: RE: [avr-gcc-list] Compiler error

Nope, my problem seems much worse and is in the "asm" constraints handling.
Attached is all details.

-----Original Message-----
From:  Joerg Wunsch ...

What's the actual error message?  (And which compiler version?)

Maybe it's related to

https://savannah.nongnu.org/bugs/?func=detailitem&item_id=13106
http://lists.gnu.org/archive/html/avr-libc-dev/2005-05/msg00020.html








reply via email to

[Prev in Thread] Current Thread [Next in Thread]