This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/64888] New: ubsan doesn't work with openmp


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)
         ^

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]