On Wed, Feb 27, 2019 at 07:03:06AM -0800, H.J. Lu wrote: > I got > > FAIL: gcc.dg/torture/pr57147-2.c -O1 scan-tree-dump-not optimized "setjmp" > FAIL: gcc.dg/torture/pr57147-2.c -O2 -flto -fno-use-linker-plugin > -flto-partition=none scan-tree-dump-not optimized "setjmp" > FAIL: gcc.dg/torture/pr57147-2.c -O2 scan-tree-dump-not optimized "setjmp" > FAIL: gcc.dg/torture/pr57147-2.c -O3 -g scan-tree-dump-not > optimized "setjmp" > FAIL: gcc.dg/torture/pr57147-2.c -Os scan-tree-dump-not optimized "setjmp" > > with unix/-fpic on x86. Should test pass with -fPIC?
Fixed thusly, committed as obvious. Before my patch it was testing that setjmp actually remains, but it was after noreturn function, I've changed it to test that it is optimized away, because the new code does optimize unreachable setjmp away. With -fpic we assume the function can be interposed and don't consider it noreturn though. 2019-02-27 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/89280 * gcc.dg/torture/pr57147-2.c (SetNaClSwitchExpectations): Add static keyword. --- gcc/testsuite/gcc.dg/torture/pr57147-2.c.jj 2019-02-27 09:40:01.860502737 +0100 +++ gcc/testsuite/gcc.dg/torture/pr57147-2.c 2019-02-27 16:20:27.957843867 +0100 @@ -10,7 +10,7 @@ extern int _setjmp (struct __jmp_buf_tag jmp_buf g_return_jmp_buf; -void SetNaClSwitchExpectations (void) +static void SetNaClSwitchExpectations (void) { __builtin_longjmp (g_return_jmp_buf, 1); } Jakub