Hello, There are 42 test files (25 under gcc.dg) that specifies
{ dg-add-options bind_pic_locally } in the regression testsuite. The procedure add_options_for_bind_pic_locally from lib/target-supports.exp adds -fPIE or -fpie when -fPIC or -fpic is passed respectively. But this is added before the dejagnu multilib options are added. So when -fPIC is passed as a multilib option, -fPIE will be unset by -fPIC (see gcc/common.opt). This should have been the behaviour since the patch http://gcc.gnu.org/ml/gcc-patches/2012-11/msg01026.html that brings all -fPIC & -fPIE variants in a Negative loop, was applied. I tried fixing this in dejagnu/target.exp by adding the multilib options before the other options: default_target_compile: < append add_flags " [board_info $dest multilib_flags]" --- > set add_flags " [board_info $dest multilib_flags] $add_flags" and ran regressions for x86_64-unknown-linux-gnu before and after the change. The only difference in the results after the change was 24 new PASSes which are from the testcases which either use bind_pic_locally or that use -fno-pic. (Interestingly, there are many test files that bind_pic_locally pass without any issue before and after the change.) I tend to think that the options added from the test files should always win. Please correct me if I'm wrong. If I'm right, is dejagnu/target.exp is the best place to fix this and the way it tried to fix? Any better suggestions? Though this case is to do with -fPIC, I'm sure there are other options which when they come as multilib options might have same issue with the some of the options added by the test files or the default options. Regards VP