From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 56FEE3857005; Thu, 27 Aug 2020 08:11:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 56FEE3857005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598515890; bh=5rniUfyno6Z1mAM8f06WzDQPdakK6diMJGOihv9OSQ8=; h=From:To:Subject:Date:From; b=QYS1ra42c9SfN68ojvP0QvoaDmcMqQ/IoaZE7VUN/crp7HD0b5Hm7Ohf+WJsIrL5v DqKV4DGjfG1SXH6o1Fey5ehzE2yBH9peFEp0tKmoG++xIE/PGzyv6gMI1FQDdtBJlQ 60d5Mke5f21gcZiK9olraj+LsbZ3bu4ztxfjdYN8= From: "weiwt.fnst at cn dot fujitsu.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/96810] New: This is a case that gcc shoud not compile successfully, but gcc acts opposite. Date: Thu, 27 Aug 2020 08:11:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: weiwt.fnst at cn dot fujitsu.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 08:11:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96810 Bug ID: 96810 Summary: This is a case that gcc shoud not compile successfully, but gcc acts opposite. Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: weiwt.fnst at cn dot fujitsu.com Target Milestone: --- In the examples below, gcc has opposite behavior when complie: These examples are from: https://www.openmp.org/wp-content/uploads/openmp-examples-5-0-1.pdf 4.5 Array Sections in Device Constructs Example array_sections.2.c As the declaration before the example says "This example shows the invalid usage of two separate sections of the same array inside of a target constru= ct" and the text annotation in the example says, gcc shoud not compile successfully. However, gcc acts opposite when compile, details are as below: test case: ------------------------------------------------- Example array_sections.2.c void foo () { int A[30], *p; #pragma omp target data map( A[0:4] ) { p =3D &A[0]; /* invalid because p[3] and A[3] are the same * location on the host but the array section * specified via p[...] is not a subset of A[0:4] */ #pragma omp target map( p[3:20] ) { A[2] =3D 0; p[8] =3D 0; } } } test command: ------------------------------------------------- #gcc -v Target: x86_64-pc-linux-gnu Configured with:./.../configure=20 --prefix=3D/.../=20 --with-gmp=3D/.../gmp-6.1.0/=20 --with-mpfr=3D/.../mpfr-3.1.4/=20 --with-mpc=3D/.../mpc-1.0.3/=20 --enable-multilib Thread model: posix gcc version 11.0.0 20200519 (experimental) (GCC) #gcc -fopenmp -I/.../include Example array_sections.2.c -------------------------------------------------=