From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29543 invoked by alias); 1 Dec 2014 04:08:53 -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 29502 invoked by uid 48); 1 Dec 2014 04:08:47 -0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/64133] m68k-rtems-gcc generates invalid code. Date: Mon, 01 Dec 2014 04:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED 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: 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: 2014-12/txt/msg00006.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64133 --- Comment #3 from Andrew Pinski --- (In reply to Chris Johns from comment #2) > Thanks for the quick response. The clean trap instruction did confuse me. > > I suppose my work around to move the code into another file stops gcc > detecting the access. Is this true ? > > I am happy to build our code with the check enabled because accessing 0 is > something we trap for with MMU targets such as ARM and PowerPC. It looks like it is just the startup code in the Init5235 function which needs this extra option, you can use the #pragma's too. Code like: *((short *)(0x00000000)) = 0; Will produce the trap.