Bug 86762

Summary: Using -fstack-protector-all causes SIGSEV with gcc-8
Product: gcc Reporter: Shane <shane>
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P3    
Version: 8.2.0   
Target Milestone: ---   
Host: Target: x86_64-apple-darwin17.7.0
Build: Known to work:
Known to fail: Last reconfirmed:
Attachments: Intermediate file

Description Shane 2018-07-31 19:28:24 UTC
Created attachment 44474 [details]
Intermediate file

Using gcc-8 from brew on macOS 10.13.6 a simple main program causes SIGSEV with -fstack-protector-all. We have confirmed this is not the case using gcc-7 and is only an issue on macOS (didn't check other versions of the OS).

The program is just as follows:
int main (int argv, char **arc)
{
    (void) argv;
    (void) argc;
    return 0;
}

compiled with:
gcc-8 main.c -O3 -o tst -Wall -Wextra -fstack-protector-all --save-temps

causes:
fish: './tst' terminated by signal SIGSEGV (Address boundary error)


gcc-8 -v:
Using built-in specs.
COLLECT_GCC=gcc-8
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/8.2.0/libexec/gcc/x86_64-apple-darwin17.7.0/8.2.0/lto-wrapper
Target: x86_64-apple-darwin17.7.0
Configured with: ../configure --build=x86_64-apple-darwin17.7.0 --prefix=/usr/local/Cellar/gcc/8.2.0 --libdir=/usr/local/Cellar/gcc/8.2.0/lib/gcc/8 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-8 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-checking=release --with-pkgversion='Homebrew GCC 8.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-nls
Thread model: posix
gcc version 8.2.0 (Homebrew GCC 8.2.0)
Comment 1 Andrew Pinski 2018-08-02 17:50:58 UTC
Dup of bug 85644.

*** This bug has been marked as a duplicate of bug 85644 ***