codeblocks command line define some default CFLAGS that use -Ofast, that is "-O3 -ffast-math", adn -ffast-math enabled, among other thing "-ffinite-math-only"... So you'll need to export a new CFLAGS without "-Ofast" or "--fast-math", launch configure again, and then it should works.