This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/64888] New: ubsan doesn't work with openmp
- From: "mikulas at artax dot karlin.mff.cuni.cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 31 Jan 2015 17:20:28 +0000
- Subject: [Bug sanitizer/64888] New: ubsan doesn't work with openmp
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
Bug ID: 64888
Summary: ubsan doesn't work with openmp
Product: gcc
Version: 4.9.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: sanitizer
Assignee: unassigned at gcc dot gnu.org
Reporter: mikulas at artax dot karlin.mff.cuni.cz
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
Undefined behavior sanitizer and openmp don't work together. Ubsan generates
some internal variables and openmp complains that shareability of these
variables haven't been defined. Try to compile this program with
gcc -fsanitize=undefined -fopenmp openmp-ubsan.c
#include <omp.h>
int main(void)
{
unsigned a = 1;
unsigned b = 2;
unsigned c;
#pragma omp parallel default(none) shared(a,b) private(c)
{
c = a / b;
}
}
openmp-ubsan.c: In function âmainâ:
openmp-ubsan.c:10:9: error: â*.Lubsan_data0â not specified in enclosing
parallel
c = a / b;
^
openmp-ubsan.c:8:9: error: enclosing parallel
#pragma omp parallel default(none) shared(a,b) private(c)
^