Bugs item #688922, was opened at 2003-02-18 18:48
Message generated for change (Settings changed) made by tecodev
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=688922&group_id=599
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: pic14 target
Group: unreproducable
>Status: Closed
Resolution: Works For Me
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Scott Dattalo (sdattalo)
Summary: Compiler fails to pass multiple byte arguments to functions
Initial Comment:
For the following test program:
void
int_function(int i)
{
while(i--)
;
}
void
char_function(const char * s)
{
while(*s++)
;
}
main()
{
int_function( 10000 );
int_function( 20000 );
char_function("string1");
char_function("string2");
}
the compile and the assembly work fine but the
generated code do not pass the arguments properly:
; int_function( 10000 );
MOVLW 0x10
MOVWF s0xFFF
MOVLW 0x27
CALL _int_function
the parameter passed in W is discarded
ther is a missing "MOVWF r0x56" in the generated
code:
; int_function(int i)
MOVF s0xFFF,W
MOVWF r0x55
_00105_DS_
MOVF r0x55,W
MOVWF r0x57
MOVF r0x56,W
MOVWF r0x58
The same thing happens for the string address
passing:
; char_function("string1");
MOVLW LOW(__str_0+0)
MOVWF s0xFFF
MOVLW (((__str_0+0) >> 8)&0xff)
CALL _char_function
There is a mising "MOVWF r0x5C" at the function
start:
; char_function(const char * s)
MOVF s0xFFF,W
MOVWF r0x5B
_00110_DS_
CALL _00116_DS_
GOTO _00117_DS_
_00116_DS_
MOVF r0x5C,W
MOVWF _PCLATH
MOVF r0x5B,W
MOVWF PCL
The bug is present in the latest CVS version. Test
program attached
My email is em@...
----------------------------------------------------------------------
Comment By: Raphael Neider (tecodev)
Date: 2005-07-01 23:57
Message:
Logged In: YES
user_id=1115835
Works with SDCC 2.5.1 #1053. I will close this in less than
two years time if nobody disagrees ;-)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=688922&group_id=599
|