Bug 637019

Summary: GCC 4.5.1 registers get clobbered when calling constructors
Product: [Fedora] Fedora Reporter: Alastair D'Silva <redhat>
Component: avr-gccAssignee: Thibault North <thibault.north>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: rhbugs, thibault.north, trond.danielsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: avr-gcc-4.5.1-2.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-12 03:14:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alastair D'Silva 2010-09-24 02:21:41 UTC
Description of problem:
In gcc/config/avr/libgcc.S, revision 143306, a change to __do_global_ctors &
__do_global_dtors was made which makes use of register r20.

This register can be used to pass parameters to the constructors, but it is not
pushed/popped from the stack, so it will get clobbered if a constructor uses
that register.


Version-Release number of selected component (if applicable):
4.5.1

How reproducible:
Very

Steps to Reproduce:
1. Compile testcase submitted at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45263
  
Actual results:
AVR microcontroller continually reboots when running the compiled binary

Expected results:
AVR microcontroller executes code as expected

Additional info:
A patch has been supplied in the above bug which works around the problem.

Comment 1 Fedora Update System 2010-09-24 15:53:55 UTC
avr-gcc-4.5.1-2.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/avr-gcc-4.5.1-2.fc14

Comment 2 Thibault North 2010-09-24 15:58:24 UTC
Thanks for your report.
Please test the new package avr-gcc-4.5.1-2 
(or here for F-13: http://koji.fedoraproject.org/koji/taskinfo?taskID=2487224 )
I would love to know if it actually fixes the problem (I can't test it here).

Thanks,
Thibault

Comment 3 Fedora Update System 2010-09-24 22:02:05 UTC
avr-gcc-4.5.1-2.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update avr-gcc'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/avr-gcc-4.5.1-2.fc14

Comment 4 Alastair D'Silva 2010-09-25 03:27:25 UTC
Tested & confirmed working on Fedora 13

Comment 5 Thibault North 2010-09-25 16:17:57 UTC
Great, thanks a lot for your help !

Comment 6 Fedora Update System 2010-10-12 03:14:11 UTC
avr-gcc-4.5.1-2.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.