On 2011-05-31 16:39, Alexander Best wrote:
...
...which leads me to the conclusion that -O should be set when DEBUG was
defined: an all ARCHS.

right now -fno-omit-frame-pointer is only set on amd64 and powerpc, if the
kernel contains DDB, KDTRACE_FRAME or HWPMC. how about this behavior? shouldn't
-fno-omit-frame-pointer be set uncondtitionally on all archs?

No, not unconditionally on all archs.  Some arches have no problem
debugging when gcc's frame pointer is turned off, namely arm, ia64,
mips, powerpc and sparc, if I read the source correctly.

On these arches, even -O already sets -fomit-frame-pointer.

So, for all arches, if DEBUG is enabled, we could just use -O (as
default only, if the user wants to override this for whatever reason, it
should be honoured).


just like
-fno-strict-aliasing?

That should only be needed in combination with -O2, if that is the
default optimization (e.g. if DEBUG is not enabled).  IMHO this option
should not be forced, if users specify their own CFLAGS/COPTFLAGS.

Summarizing, I would suggest:

- If DEBUG is enabled, use plain -O by default, on all arches
- If DEBUG is disabled, use -O2 -fno-strict-aliasing by default, on all
  arches.
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to