From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27868 invoked by alias); 10 Nov 2014 11:14:45 -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 27422 invoked by uid 48); 10 Nov 2014 11:14:40 -0000 From: "airbak.li at huawei dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/63803] When GCC 4.9.2 compile with option -O2, the target is error. Date: Mon, 10 Nov 2014 11:14:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: airbak.li at huawei dot com 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-11/txt/msg00687.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63803 --- Comment #3 from Airbak --- Thank you for your reply! "-fisolate-erroneous-paths-dereference" is a new option in GCC-4.9.x. When I use GCC-4.8.x, it is OK and will not have this problem. More and more people are switching GCC4.8 to GCC4.9, I think they will meet this problem too. Please help me and tell me how to solve it, thanks. 1. This code run after DDR init. DDR address range is 0x0 to 0x80000000. Some operation will get and set the address 0x0. 2. *((unsigned int *)0) is OK *((volatile unsigned int *)0) is not OK. Why the "volatile" makes different? 3. If I want to use option "-O2" and not contain "-fisolate-erroneous-paths-dereference", how should I configure to compile a cross-toolchain with GCC-4.9.2? I mean when compile a file with command "gcc -O2 a.c", it will not contain option "-fisolate-erroneous-paths-dereference". like: $SRCDIR/$GCC/configure --target=$TARGET \ --prefix=$INSTALLDIR_NATIVE \ --libexecdir=$INSTALLDIR_NATIVE/lib \ --infodir=$INSTALLDIR_NATIVE_DOC/info \ --mandir=$INSTALLDIR_NATIVE_DOC/man \ --htmldir=$INSTALLDIR_NATIVE_DOC/html \ --pdfdir=$INSTALLDIR_NATIVE_DOC/pdf \ --enable-languages=c,c++ \ --enable-plugins \ --disable-decimal-float \ --disable-libffi \ --disable-libgomp \ --disable-libmudflap \ --disable-libquadmath \ --disable-libssp \ --disable-libstdcxx-pch \ ...