[Bug tree-optimization/66975] New: parloops to handle signed int reductions
vries at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 23 12:35:00 GMT 2015
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.
More information about the Gcc-bugs
mailing list