bugAVR C Runtime Library - Bugs: bug #18565, Trouble with memset

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #18565: Trouble with memset

Submitter:  None
Submitted:  Wed 20 Dec 2006 12:56:21 PM UTC
   
 
Category:  Library Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Invalid Assigned to:  None
Percent Complete:  0% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

Fri 22 Dec 2006 11:10:05 PM UTC, comment #2: 

As Dmitry mentioned, this is a compiler bug rather than a library
issue.  Please submit a GCC bug report.

Joerg Wunsch <joerg_wunsch>
Group administrator
Thu 21 Dec 2006 01:53:12 AM UTC, comment #1: 

Yes, it is. However, this is not an Avr-libc bug, this is an Avr-gcc bug
in case of builtin memset() function.
I have try a set of versions:
avr-gcc 3.3.5  - OK, loop counter is separate register pare
avr-gcc 3.4.4, 4.0.2, 4.1 (prerelease)  - false code.

Compiler options: -W -Wall -Os -S
Test program:
    void * memset (void *buf, int val, unsigned int n);
    void foo (void)
    {
        memset ((char *)0x4000, 0, 0x4000);
    }

To author: whether you can to open this bug at gcc-bugzilla?

P.S. Personaly, I use for end products the 3.3 branch in general. :-)

Dmitry Xmelkov <dmix>
Group administrator
Wed 20 Dec 2006 12:56:21 PM UTC, original submission:  

When type line:
 memset((uint8_t*)0x4000, 0, 0x4000);
compiler return assembler code like this:
 ldi r30, 0x00
 ldi r31, 0x40
 st Z+, r1
 sbiw r30, 0x01
 brne .-6

so this code loop forever.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by dmix (Posted a comment)
  •  

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2006-12-22 joerg_wunsch StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code