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

 
 

bug #18565: Trouble with memset

Submitted by:  None
Submitted on:  Wed 20 Dec 2006 12:56:21 PM UTC  
 
Category: LibrarySeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: InvalidPercent Complete: 0%
Assigned to: NoneOriginator Email: -unavailable-
Open/Closed: ClosedRelease: None
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project 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.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 22 Dec 2006 11:10:05 PM UTCjoerg_wunschStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1