On Tue, 31 Jul 2018, Bogdan Harjoc wrote: > With fresh git sources and contrib/gcc_update the tests pass: > > === gcc Summary === > > # of expected passes 133500 > # of expected failures 422 > # of unsupported tests 2104 > > gcc-build/gcc/xgcc version 9.0.0 20180730 (experimental) (GCC) > > I wasn't able to reduce the input to avoid including <time.h> and as > it only reproduces without -save-temps, it's not clear how to write a > testcase for this one.
Could you give more details of the paths through the code that are involved in the infinite loop, and the different paths you get without -save-temps? Is this an issue of dependence on the values of pointers, or something like that? Is it possible to produce a test with more instances of the problem in it, say, so that the probability of the problem showing up at least once with the test is much higher? A binary search should not result in an infinite loop simply because the elements of the array are not sorted; in that case it should just converge on an unpredictable element. So more explanation of how the infinite loop occurs is needed. (But if choice of an unpredictable element results in e.g. subsequent diagnostics varying depending on pointer values, that by itself is a problem that may justify avoiding this code in the case where the array may not be sorted.) -- Joseph S. Myers jos...@codesourcery.com