#2050 Wrong type in argument

closed-fixed
8
2013-05-25
2012-06-22
No

For the attached example, sdcc makes the second argument 16-bits wide, even though it should be 32 bits.

We thus put less arguments on the stack before the call than we take from the stack after the call.

For some ports, such as. the z80-related ones this results in an assertion failure during compilation.
For other ports, such as the hc08-related ones it results in wrong code being generated silently:

_recv_broadcast:
;test.c:12: printf("", (1000L * latency) / RTIMER_ARCH_SECOND);
clra
psha
clra
psha
lda #__str_0
psha
lda #>__str_0
psha
jsr _printf
ais #6
rts

The attached source code has been created by reducing some code from the Contiki OS.

Philipp

Discussion

  • Philipp Klaus Krause

    Code to reproduce the issue

     
  • Erik Petrich

    Erik Petrich - 2012-09-07
    • labels: --> common target code generation
    • milestone: --> fixed
    • assigned_to: nobody --> epetrich
    • status: open --> closed-fixed
     
  • Erik Petrich

    Erik Petrich - 2012-09-07

    Fixed in revision #8088

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks