public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tschwinge at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/63249] New: [OpenMP] Spurious »set but not used« warnings when actually used in OpenMP target's array section's lower-bound and length
Date: Fri, 12 Sep 2014 17:43:00 -0000	[thread overview]
Message-ID: <bug-63249-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 63249
           Summary: [OpenMP] Spurious »set but not used« warnings when
                    actually used in OpenMP target's array section's
                    lower-bound and length
           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
        Depends on: 63248

This is similar to what has previously been addressed in
<https://gcc.gnu.org/PR51360>,
<http://news.gmane.org/find-root.php?message_id=%3C20111215173852.GT1957%40tyan-ft48-01.lab.bos.redhat.com%3E>:

    int f(int A, int B)
    {
      int r = 0;
      extern int *v;
      int a = 2;
      int b = 4;
      int n = 3;

      v[n] = 0;

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

    #pragma omp target map(to: v[A:B])
      r |= v[n];

      return r;
    }

    ../../openacc/w.c: In function 'f':
    ../../openacc/w.c:6:7: warning: variable 'b' set but not used
[-Wunused-but-set-variable]
       int b = 4;
       ^
    ../../openacc/w.c:5:7: warning: variable 'a' set but not used
[-Wunused-but-set-variable]
       int a = 2;
       ^
    ../../openacc/w.c:1:11: warning: parameter 'A' set but not used
[-Wunused-but-set-parameter]
     int f(int A, int B)
           ^
    ../../openacc/w.c:1:18: warning: parameter 'B' set but not used
[-Wunused-but-set-parameter]
     int f(int A, int B)
              ^
Patch (for C) submitted in
<http://news.gmane.org/find-root.php?message_id=%3C87y4trrcsk.fsf%40schwinge.name%3E>,
C++ blocked on PR63248.
>From gcc-bugs-return-461711-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 12 17:44:10 2014
Return-Path: <gcc-bugs-return-461711-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29210 invoked by alias); 12 Sep 2014 17:44:10 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 29128 invoked by uid 48); 12 Sep 2014 17:44:07 -0000
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/34777] uClibc-0.9.29 compilation error for sh4 arch with gcc-4.x
Date: Fri, 12 Sep 2014 17:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.2.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: olegendo at gcc dot gnu.org
X-Bugzilla-Status: NEW
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: dependson
Message-ID: <bug-34777-4-2IXraUsxRB@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-34777-4@http.gcc.gnu.org/bugzilla/>
References: <bug-34777-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-09/txt/msg01545.txt.bz2
Content-length: 1145

https://gcc.gnu.org/bugzilla/show_bug.cgi?id4777

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |55212

--- Comment #12 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #11)
>
> seems to fix the test case of PR 34807.  However, I've not tested it any
> further and probably the fix is incomplete and works only for mem loads and
> not stores.
> In fact it can be broken again quite easily by inserting another insn that
> requires R0 (tst #imm,r0 in this case):
>
> int glob, glob1;
>
> static int _dl_mmap (int xx)
>  {
>    register int __sc0 __asm__ ("r0") = glob1;
>    register int __sc1 __asm__ ("r1") = glob;
>
>    if (xx & 3)
>      __asm__  ("trapa %1 " : "=z" (__sc0) : "i" (0x10), "0" (__sc0), "r"
> (__sc1));
>
>    return (__sc0);
>  }
>
>  void _start(int xx)
>  {
>    static int buf;
>    buf = _dl_mmap(xx);
>  }

I've tried that test case with the sh-lra branch and the problems seem to be
gone.


             reply	other threads:[~2014-09-12 17:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 17:43 tschwinge at gcc dot gnu.org [this message]
2014-09-18 17:00 ` [Bug c++/63249] " jakub at gcc dot gnu.org
2014-09-24 15:19 ` jakub at gcc dot gnu.org
2014-09-25  6:48 ` jakub at gcc dot gnu.org
2014-09-25  6:51 ` jakub at gcc dot gnu.org
2014-09-25  6:56 ` jakub at gcc dot gnu.org

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=bug-63249-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).