public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/66975] New: parloops to handle signed int reductions
Date: Thu, 23 Jul 2015 12:35:00 -0000	[thread overview]
Message-ID: <bug-66975-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 66975
           Summary: parloops to handle signed int reductions
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

With this ( https://gcc.gnu.org/ml/gcc-cvs/2015-07/msg00896.html ) fix we
introduce xfails for signed int reductions:
...
        * gcc.dg/autopar/outer-4.c: Add xfail.
        * gcc.dg/autopar/outer-5.c: Same.
        * gcc.dg/autopar/outer-6.c: Same.
        * gcc.dg/autopar/reduc-2.c: Same.
        * gcc.dg/autopar/reduc-2char.c: Same.
        * gcc.dg/autopar/reduc-2short.c: Same.
        * gcc.dg/autopar/reduc-8.c: Same.
...

The problem is that when parallelizing reductions in parloops, we change the
order of evaluation, which can mean that we introduce an overflow, where there
was none before. This only yields the same result if the overflow behaviour can
be assumed to wrap. The fix adds this missing check.

However, we can convert the signed reduction to an unsigned one, correctly
parallelize it, and cast the result back to signed.


             reply	other threads:[~2015-07-23 12:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23 12:35 vries at gcc dot gnu.org [this message]
2015-07-26 17:54 ` [Bug tree-optimization/66975] " vries at gcc dot gnu.org
2015-07-29 11:42 ` vries at gcc dot gnu.org
2015-08-01  8:34 ` vries at gcc dot gnu.org
2015-08-01  8:36 ` vries 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-66975-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).