Hi Jakub, with the way that chunk_size < 1 is handled for gomp_iter_dynamic_next: (1) chunk_size <= -1: wraps into large unsigned value, seems to work though. (2) chunk_size == 0: infinite loop The (2) behavior is obviously not desired. This patch fixes this by changing the chunk_size initialization in gomp_loop_init to "max(1,chunk_size)" The OMP_SCHEDULE parsing in libgomp/env.c has also been adjusted to reject negative values. Tested without regressions, and a new testcase for the infinite loop behavior added. Okay for trunk? Thanks, Chung-Lin libgomp/ChangeLog: * env.c (parse_schedule): Make negative values invalid for chunk_size. * loop.c (gomp_loop_init): For non-STATIC schedule and chunk_size <= 0, set initialized chunk_size to 1. * testsuite/libgomp.c/loop-28.c: New test.