From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13881 invoked by alias); 1 Dec 2011 09:58:42 -0000 Received: (qmail 13869 invoked by uid 22791); 1 Dec 2011 09:58:41 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_GJ,TW_RJ X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Dec 2011 09:58:27 +0000 From: "gjl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/51374] [avr] insn combine reorders volatile memory accesses Date: Thu, 01 Dec 2011 09:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: major X-Bugzilla-Who: gjl at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.3 X-Bugzilla-Changed-Fields: Status Known to work Keywords Last reconfirmed Component CC Host Ever Confirmed Summary Target Milestone Known to fail Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-12/txt/msg00031.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51374 Georg-Johann Lay changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Known to work| |4.7.0 Keywords| |wrong-code Last reconfirmed| |2011-12-01 Component|c |rtl-optimization CC| |gjl at gcc dot gnu.org Host|i386-redhat-linux | Ever Confirmed|0 |1 Summary|Volatile access reordered. |[avr] insn combine reorders | |volatile memory accesses Target Milestone|--- |4.6.3 Known to fail| |4.6.2 --- Comment #1 from Georg-Johann Lay 2011-12-01 09:57:16 UTC --- Please, supply informations that are needed to reproduce bugs like explained in http://gcc.gnu.org/bugs.html/#need when you report bugs like compiler switches applied. Thanks. To reprodoce, optimization must be turned on: $ avr-gcc-4.6.2 test.c -Os -dp -S __vector_18: in r24,44-0x20 ; 8 *movqi/4 [length = 1] sbis 43-0x20,4 ; 12 *sbix_branch [length = 2] rjmp .L1 lds r24,slot.1198 ; 14 *movhi/2 [length = 4] lds r25,slot.1198+1 ldi r18,hi8(-2) ; 15 *cmphi/5 [length = 3] cpi r24,lo8(-2) cpc r25,r18 brne .L1 ; 16 branch [length = 1] ldi r24,lo8(-1) ; 18 *movhi/4 [length = 2] ldi r25,hi8(-1) sts slot.1198+1,r25 ; 19 *movhi/3 [length = 4] sts slot.1198,r24 .L1: ret ; 29 return [length = 1] avr-gcc-4.7.0 (trunk 181838) compiles correct with -O1/2/s/3, here with -Os: __vector_18: in r24,0xb ; 6 movqi_insn/4 [length = 1] in r25,0xc ; 8 movqi_insn/4 [length = 1] sbrs r24,4 ; 11 *sbrx_branchqi [length = 2] rjmp .L1 lds r24,slot.1321 ; 13 *movhi/3 [length = 4] lds r25,slot.1321+1 adiw r24,2 ; 14 *cmphi/7 [length = 1] brne .L1 ; 15 branch [length = 1] ldi r24,lo8(-1) ; 17 *movhi/5 [length = 2] ldi r25,lo8(-1) sts slot.1321+1,r25 ; 18 *movhi/4 [length = 4] sts slot.1321,r24 .L1: ret ; 35 return [length = 1]