public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ilya Verbin <iverbin@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org, Kirill Yukhin <kirill.yukhin@gmail.com>
Subject: Re: [gomp4.1] Various accelerator updates from OpenMP 4.1
Date: Fri, 04 Sep 2015 18:17:00 -0000	[thread overview]
Message-ID: <20150904180702.GB10772@msticlxl57.ims.intel.com> (raw)
In-Reply-To: <20150729171907.GI1780@tucnak.redhat.com>

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 <http://gcc.gnu.org/bugs.html> for instructions.

  -- Ilya

  reply	other threads:[~2015-09-04 18:07 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 11:44 [gomp4.1] Initial support for some OpenMP 4.1 construct parsing Jakub Jelinek
2015-04-29 11:55 ` Thomas Schwinge
2015-04-29 12:31   ` Jakub Jelinek
2015-04-29 15:20     ` Thomas Schwinge
2015-06-09 18:39     ` Ilya Verbin
2015-06-09 20:25       ` Jakub Jelinek
2015-06-25 19:47         ` Ilya Verbin
2015-06-25 20:31           ` Jakub Jelinek
2015-07-17 16:47             ` Ilya Verbin
2015-07-17 16:54               ` Jakub Jelinek
2015-07-20 16:18                 ` Jakub Jelinek
2015-07-20 18:31                   ` Jakub Jelinek
2015-07-23  0:50                     ` Jakub Jelinek
2015-07-24 20:33                       ` Jakub Jelinek
2015-07-29 17:30                         ` [gomp4.1] Various accelerator updates from OpenMP 4.1 Jakub Jelinek
2015-09-04 18:17                           ` Ilya Verbin [this message]
2015-09-04 18:25                             ` Jakub Jelinek
2015-09-07 12:48                             ` Jakub Jelinek
2015-07-20 19:40                 ` [gomp4.1] Initial support for some OpenMP 4.1 construct parsing Ilya Verbin
2015-08-24 12:38                   ` Jakub Jelinek
2015-08-24 19:10                     ` Ilya Verbin
2015-06-11 12:52       ` [gomp4.1] map clause parsing improvements Jakub Jelinek
2015-10-19 10:34         ` Thomas Schwinge
2015-10-19 10:46           ` Jakub Jelinek
2015-10-19 15:14             ` Thomas Schwinge
2015-10-20 10:10               ` Jakub Jelinek
2015-10-26 13:04                 ` Ilya Verbin
2015-10-26 13:17                   ` Jakub Jelinek
2015-10-26 14:16                     ` Ilya Verbin
2016-03-17 14:34             ` Thomas Schwinge
2016-03-17 14:37               ` Jakub Jelinek
2016-03-17 14:55                 ` Jakub Jelinek
2016-03-17 15:13                 ` Rename GOMP_MAP_FORCE_DEALLOC to GOMP_MAP_DELETE (was: [gomp4.1] map clause parsing improvements) Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150904180702.GB10772@msticlxl57.ims.intel.com \
    --to=iverbin@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=kirill.yukhin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).