You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/04/23 20:42:13 UTC

[GitHub] [incubator-nuttx] v01d commented on a change in pull request #3602: risc-v/rv32im: Set MAXOPTIMIZATION regardless of any debug options

v01d commented on a change in pull request #3602:
URL: https://github.com/apache/incubator-nuttx/pull/3602#discussion_r619485285



##########
File path: arch/risc-v/src/rv32im/Toolchain.defs
##########
@@ -67,13 +69,6 @@ ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
   endif
 endif
 
-# Individual tools may limit the optimization level but, by default, the
-# optimization level will be set to -Os
-
-ifeq ($(CONFIG_DEBUG_SYMBOLS),)
-MAXOPTIMIZATION ?= -Os

Review comment:
       I always wondered if using -Og wouldn't be better for debugging with optimizations enabled:
   
   ```
   -Og
   
       Optimize debugging experience. -Og should be the optimization level of choice for the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience. It is a better choice than -O0 for producing debuggable code because some compiler passes that collect debug information are disabled at -O0.
   
       Like -O0, -Og completely disables a number of optimization passes so that individual options controlling them have no effect. Otherwise -Og enables all -O1 optimization flags except for those that may interfere with debugging:
   
   
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org