https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63248

            Bug ID: 63248
           Summary: Crash when OpenMP target's array section handling is
                    used with templates
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: openmp
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org

Consider:

    template <typename T>
    void f(T A, T B)
    {
      extern int *v;
      T a = 2;
      T b = 4;

    #pragma omp target map(to: v[a:b])
      v[a] = 0;

    #pragma omp target map(to: v[A:B])
      v[a] = 0;
    }

    void g()
    {
      f(1, 5);
    }

GCC doesn't like that template usage:

    ../../openacc/T.C: In function 'void f(T, T)':
    ../../openacc/T.C:8:35: internal compiler error: Segmentation fault
    0xc1833f crash_signal
        ../../source/gcc/toplev.c:339
    0x697f0d tree_class_check
        ../../source/gcc/tree.h:2851
    0x697f0d cp_omp_mappable_type(tree_node*)
        ../../source/gcc/cp/decl2.c:1393
    0x764777 finish_omp_clauses(tree_node*)
        ../../source/gcc/cp/semantics.c:5671
    0x6d3d39 cp_parser_omp_all_clauses
        ../../source/gcc/cp/parser.c:28680
    0x6c6265 cp_parser_omp_target
        ../../source/gcc/cp/parser.c:30649
    [...]

Discussion in
<http://news.gmane.org/find-root.php?message_id=%3C87zje7rdho.fsf%40schwinge.name%3E>.

Reply via email to