From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2372 invoked by alias); 11 Apr 2011 17:05:00 -0000 Received: (qmail 2363 invoked by uid 22791); 11 Apr 2011 17:04:58 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,TW_RJ,TW_VR X-Spam-Check-By: sourceware.org Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.160) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Apr 2011 17:04:53 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT2k715jHQaJercGObUOFkj18odoYNahU4Q== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (business-188-111-022-002.static.arcor-ip.net [188.111.22.2]) by post.strato.de (jimi mo25) (RZmta 25.12) with ESMTPA id 2015c0n3BG6cfC ; Mon, 11 Apr 2011 18:53:28 +0200 (MEST) Message-ID: <4DA33207.9040207@gjlay.de> Date: Mon, 11 Apr 2011 17:05:00 -0000 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: "Weddington, Eric" , Denis Chertykov , Anatoly Sokolov Subject: Re: Ping: [Patch,AVR]: Fix PR45263 References: <4D96175D.8080203@gjlay.de> <4D964B36.3050008@gjlay.de> <8D64F155F1C88743BFDC71288E8E2DA801268051@csomb01.corp.atmel.com> <4D99CF65.3090002@gjlay.de> <4D9C6ADB.4060504@gjlay.de> In-Reply-To: <4D9C6ADB.4060504@gjlay.de> Content-Type: multipart/mixed; boundary="------------090604030603020305040003" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg00774.txt.bz2 This is a multi-part message in MIME format. --------------090604030603020305040003 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 1093 Georg-Johann Lay schrieb: > Georg-Johann Lay schrieb: >> Weddington, Eric schrieb: >>>> -----Original Message----- >>>> From: Georg-Johann Lay [mailto:avr@gjlay.de] >>>> Sent: Friday, April 01, 2011 4:01 PM >>>> To: Georg-Johann Lay >>>> Cc: gcc-patches@gcc.gnu.org; Denis Chertykov; Anatoly Sokolov; Weddington, >>>> Eric >>>> Subject: Re: [Patch,AVR]: Fix PR45263 >>>> >>>> This is a better fix that does not need push/pop and does not increase >>>> numer of instructions. >>>> >>>> r16 takes the role of r20, and the value formerly in r16, >>>> i.e. hh8(__dtors_end resp. __ctors_start) is recreated as needed. >>>> >>> Hi Johann, >>> >>> Have you tested this patch against the test case in bug #45263? > > Tested patch v2 from 2010-04-02 now for atmega2560 on avrtest > simulator. In main, var1 and var2 are initialized as expected and > anObject.getVal() is 30. > > Without patch the program hangs. 2011-04-11 Georg-Johann Lay PR target/45263 * config/avr/libgcc.S (__do_global_ctors, __do_global_dtors): Don't use r20 around calls of __tablejump_elpm__ --------------090604030603020305040003 Content-Type: text/x-patch; name="pr45263-v2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pr45263-v2.diff" Content-length: 1571 Index: config/avr/libgcc.S =================================================================== --- config/avr/libgcc.S (Revision 172258) +++ config/avr/libgcc.S (Arbeitskopie) @@ -791,22 +791,22 @@ __do_clear_bss: #if defined(__AVR_HAVE_RAMPZ__) __do_global_ctors: ldi r17, hi8(__ctors_start) - ldi r16, hh8(__ctors_start) ldi r28, lo8(__ctors_end) ldi r29, hi8(__ctors_end) - ldi r20, hh8(__ctors_end) + ldi r16, hh8(__ctors_end) rjmp .L__do_global_ctors_start .L__do_global_ctors_loop: sbiw r28, 2 - sbc r20, __zero_reg__ + sbc r16, __zero_reg__ mov_h r31, r29 mov_l r30, r28 - out __RAMPZ__, r20 + out __RAMPZ__, r16 XCALL __tablejump_elpm__ .L__do_global_ctors_start: cpi r28, lo8(__ctors_start) cpc r29, r17 - cpc r20, r16 + ldi r24, hh8(__ctors_start) + cpc r16, r24 brne .L__do_global_ctors_loop #else __do_global_ctors: @@ -832,22 +832,22 @@ __do_global_ctors: #if defined(__AVR_HAVE_RAMPZ__) __do_global_dtors: ldi r17, hi8(__dtors_end) - ldi r16, hh8(__dtors_end) ldi r28, lo8(__dtors_start) ldi r29, hi8(__dtors_start) - ldi r20, hh8(__dtors_start) + ldi r16, hh8(__dtors_start) rjmp .L__do_global_dtors_start .L__do_global_dtors_loop: sbiw r28, 2 - sbc r20, __zero_reg__ + sbc r16, __zero_reg__ mov_h r31, r29 mov_l r30, r28 - out __RAMPZ__, r20 + out __RAMPZ__, r16 XCALL __tablejump_elpm__ .L__do_global_dtors_start: cpi r28, lo8(__dtors_end) cpc r29, r17 - cpc r20, r16 + ldi r24, hh8(__dtors_end) + cpc r16, r24 brne .L__do_global_dtors_loop #else __do_global_dtors: --------------090604030603020305040003--