On Tue, Feb 06, 2018 at 11:14:08AM +0000, Tsimbalist, Igor V wrote: > Coincidentally, I have worked on the same patch. Please look at the patch, I > uploaded it to the bug. The main differences are > > - updated the output messages to be more informative; > - updated the tests and add couple of new tests to check the messages; > - fixed a typo in the doc file related to fcf-protection; > > I am ok with the changes in i386.c but would like to update the messages. > Could you incorporate my changes and proceed? Or would you like me to finish > the fix?
The r257414 change broke bootstrap on both x86_64-linux and i686-linux, in both the bootstrap ICEs during libitm build of aatree.cc: /.../gcc/obj70/./gcc/xg++ -B/.../gcc/obj70/./gcc/ -nostdinc++ -nostdinc++ -I/.../gcc/obj70/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/.../gcc/obj70/x86_64-pc-linux-gnu/libstdc++-v3/include -I/.../gcc/libstdc++-v3/libsupc++ -I/.../gcc/libstdc++-v3/include/backward -I/.../gcc/libstdc++-v3/testsuite/util -L/.../gcc/obj70/x86_64-pc-linux-gnu/libstdc++-v3/src -L/.../gcc/obj70/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/.../gcc/obj70/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/.../gcc/obj70/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/.../gcc/obj70/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I../../../libitm -I../../../libitm/config/linux/x86 -I../../../libitm/config/linux -I../../../libitm/config/x86 -I../../../libitm/config/posix -I../../../libitm/config/generic -I../../../libitm -mrtm -Wall -pthread -Werror -fcf-protection -mcet -std=gnu++0x -funwind-tables -fno-exceptions -fno-rtti -fabi-version=4 -g -O2 -D_GNU_SOURCE -MT aatree.lo -MD -MP -MF .deps/aatree.Tpo -c ../../../libitm/aatree.cc -fPIC -DPIC -o .libs/aatree.o /.../gcc/obj70/gcc/include/ia32intrin.h:56:28: internal compiler error: in ix86_option_override_internal, at config/i386/i386.c:4948 The problem is that the enum has {CF_NONE, CF_BRANCH, CF_RETURN, CF_FULL, CF_SET} values and the hook does: opts->x_flag_cf_protection = (cf_protection_level) (opts->x_flag_cf_protection | CF_SET); after the switch (note, bad formatting), and if called again, we end up with e.g. CF_FULL | CF_SET value which the switch doesn't handle. It isn't clear what you want to do, either ignore the CF_SET | ... values in the switch instead of gcc_unreachable on them, or switch (flag_cf_protection & ~CF_SET) or something similar. Jakub