This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gomp] Fix degenerate omp for loops (PR libgomp/29949)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]