[Bug rtl-optimization/90496] New: ICE in RTL pass pro_and_epilogue when all of `-flto -fsanitize=address -fstack-usage` are used on trivial source
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90496 Bug ID: 90496 Summary: ICE in RTL pass pro_and_epilogue when all of `-flto -fsanitize=address -fstack-usage` are used on trivial source Product: gcc Version: 8.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: gcc_bugs at codyps dot com Target Milestone: --- Compiling `int main(void) { return 0; }` with _all_ of `-flto -fsantize=address -fstack-usage` results in an ICE: ``` $ cat test1.c int main(void) { return 0; } $ ./test + : gcc + gcc -v Using built-in specs. COLLECT_GCC=/bin/gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-cet=auto Thread model: posix gcc version 8.3.0 (GCC) + gcc -o test1_a test1.c -flto -fsanitize=address + gcc -o test1_b test1.c -flto -fstack-usage + gcc -o test1_c test1.c -fsanitize=address -fstack-usage + gcc -o test1_d test1.c -flto -fsanitize=address -fstack-usage during RTL pass: pro_and_epilogue In function ‘_GLOBAL__sub_I_00099_0_cc3AMKZf.ltrans0.o’: lto1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.archlinux.org/> for instructions. lto-wrapper: fatal error: /bin/gcc returned 1 exit status compilation terminated. /bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status ``` Script from above: ``` #! /bin/bash set -xeuf -o pipefail : ${CC:=gcc} $CC -v $CC -o test1_a test1.c -flto -fsanitize=address $CC -o test1_b test1.c -flto -fstack-usage $CC -o test1_c test1.c -fsanitize=address -fstack-usage $CC -o test1_d test1.c -flto -fsanitize=address -fstack-usage ```
[Bug driver/90983] New: manual documents `-Wno-stack-usage` flag, but it is unrecognized
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90983 Bug ID: 90983 Summary: manual documents `-Wno-stack-usage` flag, but it is unrecognized Product: gcc Version: 9.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: driver Assignee: unassigned at gcc dot gnu.org Reporter: gcc_bugs at codyps dot com Target Milestone: --- Previously (in gcc-8 of some version), `-Wstack-usage=0` would disable stack-usage checking. In 9.1.0, however, `-Wstack-usage=0` appears to read "warn if any usage greater than 0 bytes occurs". This lead me to try to use the `-Wno-stack-usage` flag, which is documented in the manual: -Wno-stack-usage Disable -Wstack-usage= warnings. The option is equivalent to -Wstack-usage=SIZE_MAX or larger. However, this negative flag appears non-functional: [cody@franklin gcc]$ echo 'int main(void) { return 0; }' | /usr/bin/gcc -Wall -Werror -Wextra -Wstack-usage=0 -Wno-stack-usage -c -x c - : In function ‘main’: :1:5: error: stack usage is 16 bytes [-Werror=stack-usage=] : At top level: cc1: error: unrecognized command line option ‘-Wno-stack-usage’ [-Werror] cc1: all warnings being treated as errors (Note: I've used `-Wstack-usage=0` here to generate show that `-Wno-stack-usage` fails to disable the stack-usage warning. If no warning other warning is generated, the unrecognized command line option of `-Wno-stack-usage` is not emitted, even with `-Werror`). Indeed, looking at `gcc/common.opt` shows `RejectNegative` for `Wstack-usage=`. I haven't yet located where the behavior of `Wstack-usage` was changed wrt `0`.
[Bug driver/90983] manual documents `-Wno-stack-usage` flag, but it is unrecognized
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90983 --- Comment #1 from Cody Schafer --- It appears that commit 8e18705e1fb8213834b09c91c3ed7b15c8540d59 Author: msebor Date: Fri Jul 20 20:51:20 2018 + PR middle-end/82063 - issues with arguments enabled by -Wall Might be the change in `-Wstack-usage=0` behavior. Seems likely that this also affects `-Wframe-larger-that=` and `-Wlarger-than=` as they received similar `gcc/common.opt` modifications. This also introduced the documentation for `-Wno-stack-usage`.