From patchwork Tue May 20 08:49:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 350567 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BD44914007D for ; Tue, 20 May 2014 18:49:41 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=hJ2Nn8+UpaAvv7KdU5jnRF08LFAzq2ZFHWd7UyLo0Ic esVBBGEDTEby9n0VDZN1Tq/ZtqRrXRPdPwtnZr3jEw2ifzTQDqceOKL4BXm5Lu6D so/8heId7ThhYE9UjUv+UBFKP2oxEpVPi9/4NrOcjfXBe/gzdA/of6PCQN27H5uA = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=/2IzYrhgDb5Ug1WGTFUQYgxMvo0=; b=jK+VCjkjz1r9ldddq 5RVPx+vXqhAY61kMhVcjH4ot6QD9tnPe0uA4Al9iLWjx+W2txP3gjd8oWkrDecOl tpNmexwIlN1BN/WI1TkCgfXTP97h5eYHNtTACdkn0hs1WlqCMxXJwPPVNEsWRrmg l/nt3+J3i7Vg+XOu4Gz+N55aAU= Received: (qmail 32198 invoked by alias); 20 May 2014 08:49:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 32189 invoked by uid 89); 20 May 2014 08:49:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.216) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 20 May 2014 08:49:33 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT3ol15ykJcYwTPbBBR62PQ25nZqaVhI= X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (91-67-174-249-dynip.superkabel.de [91.67.174.249]) by smtp.strato.de (RZmta 34.2 DYNA|AUTH) with ESMTPSA id z02d68q4K8lMLfk (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate); Tue, 20 May 2014 10:47:22 +0200 (CEST) Message-ID: <537B170C.2030306@gjlay.de> Date: Tue, 20 May 2014 10:49:16 +0200 From: Georg-Johann Lay User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130911 Thunderbird/17.0.9 MIME-Version: 1.0 To: GCC Patches CC: Denis Chertykov , Senthil Kumar Selvaraj Subject: [backport,avr,47] Apply fix for PR60991 X-IsSubscribed: yes Backportet the fix for PR60991 also to 4.7 so that the issue can be closed: http://gcc.gnu.org/r210635 Johann gcc/ 2014-05-20 Senthil Kumar Selvaraj Backport from mainline r210325 2014-05-12 Senthil Kumar Selvaraj PR target/60991 * config/avr/avr.c (avr_out_store_psi): Use correct constant to restore Y. gcc/testsuite/ 2014-05-20 Senthil Kumar Selvaraj Backport from mainline r210325 2014-05-12 Senthil Kumar Selvaraj PR target/60991 * gcc.target/avr/pr60991.c: New testcase. Index: config/avr/avr.c =================================================================== --- config/avr/avr.c (revision 210633) +++ config/avr/avr.c (working copy) @@ -3643,7 +3643,7 @@ avr_out_store_psi (rtx insn, rtx *op, in "std Y+61,%A1" CR_TAB "std Y+62,%B1" CR_TAB "std Y+63,%C1" CR_TAB - "sbiw r28,%o0-60", op, plen, -5); + "sbiw r28,%o0-61", op, plen, -5); return avr_asm_len ("subi r28,lo8(-%o0)" CR_TAB "sbci r29,hi8(-%o0)" CR_TAB Index: testsuite/gcc.target/avr/pr60991.c =================================================================== --- testsuite/gcc.target/avr/pr60991.c (revision 0) +++ testsuite/gcc.target/avr/pr60991.c (revision 0) @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-options "-O1" } */ + +/* This testcase (simplified from the original bug report) exposes + PR60991. The code generated for writing the __int24 value corrupts + the frame pointer if the offset is <= 63 + MAX_LD_OFFSET */ + +#include + +int main(void) +{ + volatile char junk[62]; + junk[0] = 5; + volatile __int24 staticConfig = 0; + + if (junk[0] != 5) + abort(); + + exit(0); + return 0; +}