From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8079 invoked by alias); 7 Apr 2015 20:33:00 -0000 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 Received: (qmail 8012 invoked by uid 48); 7 Apr 2015 20:32:56 -0000 From: "senthil_kumar.selvaraj at atmel dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65657] [avr] read from __memx address space tramples argument to following function Date: Tue, 07 Apr 2015 20:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: senthil_kumar.selvaraj at atmel dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg00464.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65657 Senthil Kumar Selvaraj changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |senthil_kumar.selvaraj@atme | |l.com --- Comment #3 from Senthil Kumar Selvaraj --- Happens on a recent trunk build as well. Here's a simpler testcase. $ cat foo.c void foo (char a, unsigned int b); void readx (const char __memx *x) { foo (*x, 0xABCD); } $ avr-gcc -mmcu=atmega1280 foo.c -S -Os $ cat foo.s mov r18,r22 mov r25,r23 ldi r22,lo8(-51); Load 0xABCD into r22:r23 in prep for call to foo ldi r23,lo8(-85) mov r30,r18 mov r31,r25 mov r21,r24 call __xload_1; r22 clobbered here mov r24,r22 jmp foo