On Thu, Oct 15, 2015 at 9:57 AM, Uros Bizjak <ubiz...@gmail.com> wrote: > On Thu, Oct 15, 2015 at 1:45 PM, Uros Bizjak <ubiz...@gmail.com> wrote: >> On Wed, Oct 14, 2015 at 5:08 PM, Yulia Koval <vaalfr...@gmail.com> wrote: >>> Hi, >>> >>> This patch fixes the issue: >>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67963 >>> >>> gcc/config/i386/i386.c (ix86_option_override_internal) Disable >>> 80387 mask if lakemont target is set. >>> >>> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c >>> index 4c25c9e..db722aa 100644 >>> --- a/gcc/config/i386/i386.c >>> +++ b/gcc/config/i386/i386.c >>> @@ -4943,6 +4943,12 @@ ix86_option_override_internal (bool main_args_p, >>> break; >>> } >>> >>> + if (!strcmp (opts->x_ix86_arch_string, "lakemont")) >>> + { >>> + opts->x_target_flags &= ~MASK_80387; >>> + opts_set->x_target_flags |= MASK_80387; >>> + } >>> + >>> if (TARGET_X32 && (opts->x_ix86_isa_flags & OPTION_MASK_ISA_MPX)) >>> error ("Intel MPX does not support x32"); >>> >>> Ok for trunk? >> >> The problem is in TARGET_SUBTARGET{32,64}_DEFAULT, that will override >> set target flags, unless relevant bit of opts_set->x_target_flags is >> set. However, we can't just set x_target_flag, because >> __attribute__((target("arch=...."))) won't work. Unfortunately, my >> proposed patch in the PR violates this last requirement. >> >> This can probably be solved by adding local "x_target_flags_mask" and >> use it after TARGET_SUBTARGET processing. > > Attached is a final patch I plan to commit to mainline soon. > > 2015-10-15 Uros Bizjak <ubiz...@gmail.com> > > PR target/67963 > * config/i386/i386.c (ix86_option_override_internal): Add PTA_NO_80387. > Add PTA_NO_80387 to "lakemont". Disable MASK_80387 target flag > after target flags were initialized to target defaults. > > testsuite/ChangeLog: > > 2015-10-15 Uros Bizjak <ubiz...@gmail.com> > > PR target/67963 > * gcc.target/i386/pr67963-1.c: New test. > * gcc.target/i386/pr67963-2.c: Ditto. > > Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. > > Uros.
Do we support -O2 -march=lakemont with __attribute__((target("arch=silvermont"))) -- H.J.