From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2659 invoked by alias); 24 Sep 2012 15:04:32 -0000 Received: (qmail 2532 invoked by uid 48); 24 Sep 2012 15:04:07 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/54692] [4.8 Regression] gcc doesn't build with "-Og -g" Date: Mon, 24 Sep 2012 15:04: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: 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: 2012-09/txt/msg01964.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54692 --- Comment #9 from Jakub Jelinek 2012-09-24 15:04:06 UTC --- (In reply to comment #8) > (In reply to comment #6) > > Guess > > *) CFLAGS=`echo $CFLAGS | sed "s/-O[[s0-9]]* *//" ` > > CXXFLAGS=`echo $CXXFLAGS | sed "s/-O[[s0-9]]* *//" ` ;; > > needs to be now > > -O[[s0-9gf]] instead (also for -Ofast). > > That said, I don't see how it is related to using STAGE1_CFLAGS (note missing > > XX). > > I wonder why we do the above at all? I suppose that's for removing > a configure default, but the toplevel passes STAGE1_CFLAGS as CFLAGS to > gcc configure (that's why we need to re-specify CFLAGS on the make > command-line?!). The intent of this is to make sure that the toplevel Makefile has whatever fancy CXXFLAGS/CFLAGS is needed for bootstrapping, and gcc/Makefile has corresponding CXXFLAGS/CFLAGS without -O2 or similar in it. Thus, if in --disable-bootstrap (or cross) gcc you do make in toplevel, you are building an optimized compiler, while cd gcc; make after you tweak stuff here and there will default to no optimization and thus hopefully better debugging experience. If/when -Og is better than -O0 for debug experience surely we can use there -Og instead. >>From toplevel make just passes down CXXFLAGS/CFLAGS, so the values stored in gcc/Makefile are ignored.