On Tue, Dec 20, 2016 at 11:22:47AM +0100, Dominik Vogt wrote:
> On Mon, Dec 19, 2016 at 06:00:21PM +0100, Jakub Jelinek wrote:
> > On Mon, Dec 19, 2016 at 05:50:40PM +0100, Dominik Vogt wrote:
> > >   * config/s390/s390-c.c (s390_cpu_cpp_builtins_internal): Define
> > >   __S390_ARCH_LEVEL__.
> > > gcc/testsuite/ChangeLog-setmem
> > > 
> > >   * gcc.target/s390/md/setmem_long-1.c: Use "runnable".
> > >   * gcc.target/s390/md/rXsbg_mode_sXl.c: Likewise.
> > >   * gcc.target/s390/md/andc-splitter-1.c: Likewise.
> > >   * gcc.target/s390/md/andc-splitter-2.c: Likewise.
> > >   * lib/gcc-dg.exp (gcc-dg-runtest): Export torture_current_flags.
> > >   * gcc.target/s390/s390.exp: Import torture_current_flags.
> > >   (check_effective_target_runnable): New.
> > 
> > Unless you want to add support for all targets in the runnable
> > effective target, I think it would be better to call it less generically,
> > s390_runnable or similar.
> 
> Fair enough.
> 
> What do you think about the change in gcc-dg.exp?
> 
> We couldn't
> decide whether it's a valid way of retrieving the flags needed for
> compiling s390_check_runnable or not.  It would be nice to get all
> options that are relevant for the test case, including the ones
> from "dg-options" (etc.), but that probably requires larger
> changes to lib/*.exp.  (The target specific check functions could
> be removed then.)

I'm not a testsuite maintainer nor very good in tcl, so I think you want a
testsuite maintainer to ack it in any case.
But, I'd say you want something that will not be terribly expensive.
If you have an effective target that happens to get flags from the
current test, then that is necessarily non-cacheable, which would mean
in addition to compiling every test you also compile another proglet for it.
I think your current patch does that too, there is no caching, so it would
be desirable to cache the results; you should invalidate those caches when
torture_current_flags change.  See e.g. et_cache uses in
target-supports.exp.  You want to remember torture_current_flags for which
you've computed the s390_runnable et and if it changes, reset the cache.
The other *_runnable flags can be probably just normally cached (and you do,
by using check_runtime rather than check_runtime_nocache).

        Jakub

Reply via email to