public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/66975] New: parloops to handle signed int reductions
@ 2015-07-23 12:35 vries at gcc dot gnu.org
  2015-07-26 17:54 ` [Bug tree-optimization/66975] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2015-07-23 12:35 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-01  8:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-23 12:35 [Bug tree-optimization/66975] New: parloops to handle signed int reductions vries at gcc dot gnu.org
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

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).