I configured swift with the --enable-debug flag when running swift it says that it was compiled with the following CFLAGS
CFLAGS : '-g -O0 -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -funroll-loops -mcpu=native -fno-vectorize -fno-slp-vectorize -pthread -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -Wall -Wextra -Wno-unused-parameter -Wshadow -Werror -Wstrict-prototypes'
and the -O0 from the --enable-debug flag is overwritten.
This is intentional, since --enable-debug is only meant to turn on debugging info. If you want to disable optimisations as well, you also have to use --disable-optimization when configuring.
I configured swift with the --enable-debug flag when running swift it says that it was compiled with the following CFLAGS
CFLAGS : '-g -O0 -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -funroll-loops -mcpu=native -fno-vectorize -fno-slp-vectorize -pthread -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -Wall -Wextra -Wno-unused-parameter -Wshadow -Werror -Wstrict-prototypes'
and the -O0 from the --enable-debug flag is overwritten.