This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp] Fix degenerate omp for loops (PR libgomp/29949)
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 01 Dec 2006 16:23:49 -0500
- Subject: Re: [gomp] Fix degenerate omp for loops (PR libgomp/29949)
- References: <20061201163236.GW6570@devserv.devel.redhat.com>
Jakub Jelinek wrote on 12/01/06 11:32:
Lastly, the compiler expanded loops (static without chunk size, static with
chunk size) failed because the arithmetics to compute range given to the
current thread was mostly done in unsigned long and thus when N2 - N1
was negative (for positive STEP resp. positive for negative STEP), we ended
up with a huge range. I tried to figure out why this was cast to utype,
but haven't found why it has been written that way.
I don't remember any particular reason. I hadn't thought of this
corner case. Good catch.
2006-12-01 Jakub Jelinek <jakub@redhat.com>
PR libgomp/29949
* omp-low.c (expand_omp_for_static_nochunk,
expand_omp_for_static_chunk): Do all arithmetics in signed rather than
unsigned type.
* loop.c (gomp_loop_init): Make parameters signed. Set ws->end to
start if there shouldn't be any loop iterations.
(gomp_loop_ordered_static_start): Remove start == end test.
* testsuite/libgomp.c/pr29949-1.c: New test.
* testsuite/libgomp.c/pr29949-2.c: New test.
OK everywhere.