bugAVR C Runtime Library - Bugs: bug #26284, boot_lock_fuse_bits_get does not...

 
 

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

bug #26284: boot_lock_fuse_bits_get does not compile under gcc 4.3.X

Submitter:  Brad Schick <schickb>
Submitted:  Wed 22 Apr 2009 07:17:50 AM UTC
   
 
Category:  Library Severity:  3 - Normal
Priority:  5 - Normal Item Group:  libc code
Status:  Fixed Assigned to:  arcanum
Percent Complete:  100% Open/Closed:  Closed
Release:  1.6.5 Fixed Release:  1.6.4

Sat 25 Apr 2009 09:16:24 PM UTC, comment #2: 

Thanks for the patch!

Eric Weddington <arcanum>
Group administrator
Wed 22 Apr 2009 07:51:49 AM UTC, comment #1: 

This actually may have been like for a long time, but I think it should still be changed. As is, the macro is a hassle to use since it doesn't accept a variable; it must be hard-coded in a switch statement or something. Also, the very similar 'boot_signature_byte_get' isn't limited to constants. My patch makes 'boot_lock_fuse_bits_get' more flexible like 'boot_signature_byte_get'.

Also there is no need to explicitly mark r0, r31, r30 as clobbered. r0 is not changed by LPM, only by SPM

Brad Schick <schickb>
Wed 22 Apr 2009 07:17:50 AM UTC, original submission:  

The 'boot_lock_fuse_bits_get' macro in <avr/boot.h> causes a compile error when passed a non-constant argument. Building the code below in a fairly recent version of GCC (like 4.3.2) produces the error:


#include <avr/io.h>
#include <avr/boot.h>
#include <stdint.h>

void main()
{
    uint16_t addr = 0x0003;
    return boot_lock_fuse_bits_get(addr);
}


The error will be something like:

warning: asm operand 3 probably doesn't match constraints
error: impossible constraint in 'asm'

The problem seems to be the use of the "M" constraint in the macro. I believe the attached patch should fix the issue, and is a bit simpler as well.

Brad Schick <schickb>

 

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

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arcanum (Posted a comment)
  • -email is unavailable- added by schickb (Submitted the item)
  •  

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-04-25 arcanum StatusNone Fixed
        Percent Complete0% 100%
        Assigned toNone arcanum
        Open/ClosedOpen Closed
        Fixed ReleaseNone 1.6.4
    2009-04-22 schickb Attached File- Added boot_lock_fuse_bits_get.patch, #17992

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code