Avoid invalid memory optimizations (#20389)

When building for AVR, merge-all-constants can incorrectly combine constants stored in flash with constants stored in RAM. These have different access requirements, leading to undefined behavior during execution.
Co-authored-by: ellensp <ellensp@hotmail.com>
This commit is contained in:
Victor Oliveira 2020-12-06 17:36:36 -03:00 committed by Scott Lahteine
parent 3a73f04fd3
commit 72eda1d3ae

View File

@ -203,7 +203,7 @@ extra_scripts =
pre:buildroot/share/PlatformIO/scripts/common-dependencies.py
pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
post:buildroot/share/PlatformIO/scripts/common-dependencies-post.py
build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants
build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-constants
lib_deps =
#