Bug 35625 - schedule(guided) loops forever if ((end - start) % incr) != 0
Summary: schedule(guided) loops forever if ((end - start) % incr) != 0
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgomp (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords: openmp
Depends on:
Blocks:
 
Reported: 2008-03-18 09:05 UTC by Jakub Jelinek
Modified: 2008-03-18 09:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2008-03-18 09:05:53 UTC
int
main (void)
{
#pragma omp parallel
  {
    #pragma omp for schedule (guided, 10)
      for (int i = 0; i < 1826; i += 10)
        ;
    #pragma omp for schedule (guided, 10)
      for (int i = 0; i > -1826; i -= 10)
        ;
  }
  return 0;
}
hangs - after going through all iterations keeps calling GOMP_*_next forever,
each time returning true and assigning an empty range.
Comment 1 Jakub Jelinek 2008-03-18 09:55:07 UTC
Subject: Bug 35625

Author: jakub
Date: Tue Mar 18 09:54:21 2008
New Revision: 133306

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133306
Log:
	PR libgomp/35625
	* iter.c (gomp_iter_guided_next_locked): If q > n, set end to ws->end.
	(gomp_iter_guided_next): Likewise.
	* testsuite/libgomp.c/pr35625.c: New test.

Added:
    trunk/libgomp/testsuite/libgomp.c/pr35625.c
Modified:
    trunk/libgomp/ChangeLog
    trunk/libgomp/iter.c

Comment 2 Jakub Jelinek 2008-03-18 09:55:58 UTC
Subject: Bug 35625

Author: jakub
Date: Tue Mar 18 09:55:09 2008
New Revision: 133307

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133307
Log:
	PR libgomp/35625
	* iter.c (gomp_iter_guided_next_locked): If q > n, set end to ws->end.
	(gomp_iter_guided_next): Likewise.
	* testsuite/libgomp.c/pr35625.c: New test.

Added:
    branches/gcc-4_3-branch/libgomp/testsuite/libgomp.c/pr35625.c
Modified:
    branches/gcc-4_3-branch/libgomp/ChangeLog
    branches/gcc-4_3-branch/libgomp/iter.c

Comment 3 Jakub Jelinek 2008-03-18 09:57:04 UTC
Fixed.