On 4/29/21 11:06 PM, Hans Petter Selasky wrote: > Hi, > > Can someone please explain what C-compiler flag I'm missing, to make > this simple C-program terminate? > > I have a function _abs() which at some point is equal to one, but the > compiler thinks it is not required to emit the test for the while() at > all, looking at the assembly code! A printf() clearly verifies that the > _abs() function has returned one. > > clang11 -O2 test.c && ./a.out Looks like -fwrapv fixes the issue. Sorry for the noise. --HPSReceived on Thu Apr 29 2021 - 19:12:54 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:28 UTC