Created attachment 49356 [details] Header file While testing gcc 10.2 with MUSL for libc, I noticed some of analyzer setjmp tests in the gcc validation suite were failing. I managed to get a somewhat reduced testcase and determined that the problem was due to this #define in setjmp.h for MUSL: #define setjmp setjmp In glibc, the corresponding #define is: #define setjmp(env) _setjmp(env) and the testcases pass when that is used.
Created attachment 49357 [details] Source file
Created attachment 49358 [details] Expected output
Created attachment 49359 [details] Incorrect output
To run this, just use "gcc -fanalyzer -S -o /dev/null setjmp.c"
Created attachment 49366 [details] [PATCH] analyzer: don't use <setjmp.h> in tests [PR97394] Thanks for filing this bug. Does this patch fix the testsuite for you?
Yes, thanks for the quick fix.
The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>: https://gcc.gnu.org/g:974e3975c5bd14ee8817f892532d1e55492227df commit r11-3894-g974e3975c5bd14ee8817f892532d1e55492227df Author: David Malcolm <dmalcolm@redhat.com> Date: Tue Oct 13 15:56:45 2020 -0400 analyzer: don't use <setjmp.h> in tests [PR97394] PR analyzer/97394 reports issues with analyzer setjmp results when testing against MUSL. This patch fixes up gcc.dg/analyzer so that it doesn't use <setjmp.h>. gcc/testsuite/ChangeLog: PR analyzer/97394 * gcc.dg/analyzer/setjmp-pr93378.c: Use test-setjmp.h rather than <setjmp.h>. * gcc.dg/analyzer/sigsetjmp-5.c: Likewise. * gcc.dg/analyzer/sigsetjmp-6.c: Likewise. * gcc.dg/analyzer/test-setjmp.h: Don't include <setjmp.h>. Provide decls of jmp_buf, sigjmp_buf, setjmp, sigsetjmp, longjmp, and siglongjmp.
(In reply to Michael Morrell from comment #6) > Yes, thanks for the quick fix. Thanks for confirming.