On Sun, Oct 11, 2015 at 11:29:36AM -0700, Ian Lance Taylor wrote: > On Sun, Oct 11, 2015 at 7:43 AM, Andreas Schwab <sch...@linux-m68k.org> wrote > > > > Please remind me why this logic isn't implemented as a target hook. > > > > supports_split_stack = TARGET_CAN_SPLIT_STACK; > > > > /* rs6000.h */ > > #define TARGET_CAN_SPLIT_STACK TARGET_64BIT > > There is a target hook for split stack support in > gcc/common/common-target.def. The PPC version of it is in > gcc/common/config/rs6000/rs6000-common.c. > > But the issue here is that we need access from the gccgo driver > program. Can the driver program call the common target hooks?
Not the way the gccgo driver is currently written. In lang_specific_driver you get to see global_options as set up by init_options_struct. TARGET_64BIT, used by the hook, is at its default value rather than what you'd see after command line option processing. This isn't at all surprising when you consider that lang_specific_driver must run before option processing since one of its jobs is to insert command line options. -- Alan Modra Australia Development Lab, IBM