This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

insn-flags vs ia64 eh


Anybody got a better way to do 

---------
/* Just because the user configured --with-sjlj-exceptions=no doesn't
   mean that we can use call frame exceptions.  Detect that the target
   has appropriate support.  */

#if !defined (EH_RETURN_DATA_REGNO)		\
    || !defined(EH_RETURN_STACKADJ_RTX)		\
    || ! (defined(EH_RETURN_HANDLER_RTX)	\
	  || defined(HAVE_eh_return))		\
    || ! (defined(DWARF2_UNWIND_INFO)		\
	  || defined(IA64_UNWIND_INFO))
#define MUST_USE_SJLJ_EXCEPTIONS	1
#else
#define MUST_USE_SJLJ_EXCEPTIONS	0
#endif

#ifdef CONFIG_SJLJ_EXCEPTIONS
# if CONFIG_SJLJ_EXCEPTIONS == 1
#  define USING_SJLJ_EXCEPTIONS		1
# endif
# if CONFIG_SJLJ_EXCEPTIONS == 0
#  define USING_SJLJ_EXCEPTIONS		1
#  ifndef EH_RETURN_DATA_REGNO
    #error "EH_RETURN_DATA_REGNO required"
#  endif
#  ifndef EH_RETURN_STACKADJ_RTX
    #error "EH_RETURN_STACKADJ_RTX required"
#  endif
#  if !defined(EH_RETURN_HANDLER_RTX) && !defined(HAVE_eh_return)
    #error "EH_RETURN_HANDLER_RTX or eh_return required"
#  endif
#  if !defined(DWARF2_UNWIND_INFO) && !defined(IA64_UNWIND_INFO)
    #error "{DWARF2,IA64}_UNWIND_INFO required"
#  endif
# endif
#else
# define USING_SJLJ_EXCEPTIONS		MUST_USE_SJLJ_EXCEPTIONS
#endif
---------

that doesn't rely on insn-flags.h for HAVE_eh_return?  Adding
this fragment to except.h has required a zillion changes to
header include order, and has generally been a Bad Idea.

Moreover, how to get this seen by libgcc without hackery like

---------
# ??? Need extra help to get this definition copied to where libgcc can
# see it.  It shouldn't matter which compiler we use to get there.
        echo '#include "config.h"' > conftest.c
        echo '#include "rtl.h"' >> conftest.c
        echo '#include "insn-flags.h"' >> conftest.c
        echo '#include "except.h"' >> conftest.c
        echo 'xyzzy USING_SJLJ_EXCEPTIONS' >> conftest.c
        $(HOST_CC) -E conftest.c $(HOST_CFLAGS) $(INCLUDES) > conftest.out
        sed -e 's/xyzzy/#define USING_SJLJ_EXCEPTIONS/' -e '/#define/p' \
                -e d conftest.out >> tconfig.h
        rm conftest.*
---------


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]