SourceForge has been redesigned. Learn more.
Close

#894 Incorrect use of cached cast

closed-fixed
None
5
2013-05-25
2005-03-10
Simon Berg
No

In the attached C file the second line of USB_send_data
causes len to be cast to a 16 bit word and that word is
stored
in _USB_send_data_sloc1_1_0 .
It's later used by the printf function for it's len
argument.
The problem is that len (mapped to _USB_send_data_PARM_3)
is changed in between and an old value is used by printf.

Sorry about the complicated test case but it seems very
dependant
on the number of variables allocated (or something),
and as soon as
I remove something the problem goes away.

Compiled with: sdcc -mmcs51 -S fail.c
Version:
SDCC :
mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
2.4.0 (Dec 15 2004) (UNIX)

Discussion

  • Simon Berg

    Simon Berg - 2005-03-10
     
  • Erik Petrich

    Erik Petrich - 2005-03-17
    • assigned_to: nobody --> epetrich
     
  • Erik Petrich

    Erik Petrich - 2005-03-20
    • milestone: --> fixed
    • status: open --> closed-fixed
     
  • Erik Petrich

    Erik Petrich - 2005-03-20

    Logged In: YES
    user_id=635249

    I believe that this bug is now fixed in version 2.4.8 #980,
    although it is subtle enough that I can't say that with
    absolute certainty. In any case, the current test case
    appears to compile correctly now.

     

Log in to post a comment.