1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-23 03:53:43 +01:00

Fix crasher test for gcc >= 8 when using -O2 or -O3. (#67)

This commit is contained in:
Romain Geissler @ Amadeus 2018-03-06 17:06:44 +01:00 committed by Dave Watson
parent 7f04c2032f
commit 54c1afdd51

View file

@ -87,6 +87,11 @@ write_maps(char *fname)
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
#ifndef __clang__
// Gcc >= 8 became too good at inlining aliase c into b when using -O2 or -O3,
// so force -O1 in all cases, otherwise a frame will be missing in the tests.
#pragma GCC optimize "-O1"
#endif
int c(int x) NOINLINE ALIAS(b); int c(int x) NOINLINE ALIAS(b);
#define compiler_barrier() asm volatile(""); #define compiler_barrier() asm volatile("");
#else #else