This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/54692] gcc doesn't build with "-Og -g"
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Sep 2012 07:27:15 +0000
- Subject: [Bug other/54692] gcc doesn't build with "-Og -g"
- Auto-submitted: auto-generated
- References: <bug-54692-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54692
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.0 |---
--- Comment #12 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-25 07:27:15 UTC ---
(In reply to comment #9)
> (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.
Hm. Doesn't make much sense to be - but anyway.