From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112449 invoked by alias); 4 Sep 2015 18:07:19 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 112373 invoked by uid 89); 4 Sep 2015 18:07:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f173.google.com Received: from mail-ig0-f173.google.com (HELO mail-ig0-f173.google.com) (209.85.213.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 04 Sep 2015 18:07:16 +0000 Received: by igbni9 with SMTP id ni9so19636160igb.0 for ; Fri, 04 Sep 2015 11:07:14 -0700 (PDT) X-Received: by 10.50.134.198 with SMTP id pm6mr10068563igb.53.1441390033884; Fri, 04 Sep 2015 11:07:13 -0700 (PDT) Received: from msticlxl57.ims.intel.com ([192.55.54.40]) by smtp.gmail.com with ESMTPSA id o19sm1948881igs.18.2015.09.04.11.07.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Sep 2015 11:07:13 -0700 (PDT) Date: Fri, 04 Sep 2015 18:17:00 -0000 From: Ilya Verbin To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org, Kirill Yukhin Subject: Re: [gomp4.1] Various accelerator updates from OpenMP 4.1 Message-ID: <20150904180702.GB10772@msticlxl57.ims.intel.com> References: <20150609202426.GG10247@tucnak.redhat.com> <20150625194529.GB33078@msticlxl57.ims.intel.com> <20150625201058.GK10247@tucnak.redhat.com> <20150717163136.GB15252@msticlxl57.ims.intel.com> <20150717164306.GT1780@tucnak.redhat.com> <20150720161422.GC1780@tucnak.redhat.com> <20150720181041.GE1780@tucnak.redhat.com> <20150722211348.GA1750@tucnak.redhat.com> <20150724200457.GB1750@tucnak.redhat.com> <20150729171907.GI1780@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150729171907.GI1780@tucnak.redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00366.txt.bz2 Hi! It seems that there is a bug some here: On Wed, Jul 29, 2015 at 19:19:07 +0200, Jakub Jelinek wrote: > @@ -12918,6 +12989,28 @@ lower_omp_target (gimple_stmt_iterator * > var = var2; > } > > + if (offloaded > + && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_POINTER) > + { > + if (TREE_CODE (TREE_TYPE (var)) == ARRAY_TYPE) > + { > + tree type = build_pointer_type (TREE_TYPE (var)); > + tree new_var = lookup_decl (var, ctx); > + x = create_tmp_var_raw (type, get_name (new_var)); > + gimple_add_tmp_var (x); > + x = build_simple_mem_ref (x); > + SET_DECL_VALUE_EXPR (new_var, x); > + DECL_HAS_VALUE_EXPR_P (new_var) = 1; > + } > + continue; > + } > + > + if (offloaded && OMP_CLAUSE_MAP_PRIVATE (c)) > + { > + map_cnt++; > + continue; > + } > + > if (!maybe_lookup_field (var, ctx)) > continue; > Here is the reproducer: #pragma omp declare target int a[1]; #pragma omp end declare target void foo () { #pragma omp target map(to: a[0:1]) a; } lookup_decl (var, ctx) tries to lookup for 'a', but ctx->cb.decl_map->get () returns null-pointer. $ gcc -fopenmp -c test.c test.c: In function ‘foo’: test.c:7:11: internal compiler error: Segmentation fault #pragma omp target map(to: a[0:1]) ^ 0xd27276 crash_signal gcc/toplev.c:352 0xbae3fa lookup_decl gcc/omp-low.c:1056 0xbe208c lower_omp_target gcc/omp-low.c:13362 0xbe8464 lower_omp_1 gcc/omp-low.c:14504 0xbe8911 lower_omp gcc/omp-low.c:14592 0xbe8017 lower_omp_1 gcc/omp-low.c:14436 0xbe8911 lower_omp gcc/omp-low.c:14592 0xbe808b lower_omp_1 gcc/omp-low.c:14445 0xbe8911 lower_omp gcc/omp-low.c:14592 0xbe8ad9 execute_lower_omp gcc/omp-low.c:14630 0xbe8b7e execute gcc/omp-low.c:14667 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. -- Ilya