On Wed, 2012-05-30 at 14:27 -0400, David Edelsohn wrote: > On Wed, May 30, 2012 at 1:39 PM, Steve Ellcey <sell...@mips.com> wrote: > > > > > My question is: When checking the value of TARGET_SYNCI is there anyway > > to tell if the flag was set explicitly by the user or implicitly by > > the compiler? The reason I want to know is that if I build GCC for MIPS > > today and configure with --with-synci then some tests fail because > > the test specifies an old MIPS architecture that doesn't support synci > > and the test prints a warning: > > > > if (TARGET_SYNCI && !ISA_HAS_SYNCI) > > { > > warning (0, "the %qs architecture does not support the synci " > > "instruction", mips_arch_info->name); > > target_flags &= ~MASK_SYNCI; > > } > > > > Ideally, this warning should only be printed if the user explicitly asked > > for -msynci, not if -msynci was merely set as the default. But I am not > > sure > > how to tell the difference between those two situations. > > I think you want to examine target_flags_explicit. > > - David
That looks like what I want but when I try to use it, it doesn't seem to work. I put 'if ((target_flags_explicit & MASK_SYNCI) != 0)' in front of the warning but I still get the warning if I configure GCC with '--with-synci' regardless of whether or not I explicitly use -msynci on the GCC command line. When I look at the value of target_flags_explicit, the MASK_SYNCI bit always seems to be on, regardless of whether or not I configured GCC with '--with-synci' and only the value in target_flags seems to be changing to reflect whether or not to use synci. Perhaps my understanding of target_flags_explicit is wrong but I assumed it would set bits for whatever flags are on in target_flags but only if they were set explicitly by the user. Steve Ellcey sell...@mips.com