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]
Other format: [Raw text]

Re: [patch] Cleanup diagnostic.h in the gimple passes


On Wed, Jun 2, 2010 at 7:00 PM, IainS <developer@sandoe-acoustics.co.uk> wrote:

>> I have no idea if/how that can be related. I'll have a look.
>
> maybe it isn't related..
> ... however, maybe defaults.h needs including somewhere else - now ...
> ... I note that there are macros dealing with exceptions in your list.
> (but confess that I have not looked in detail at any of it ;-))

Well, I have. The problem is in this piece:

-#ifndef MUST_USE_SJLJ_EXCEPTIONS
-# if defined (EH_RETURN_DATA_REGNO)                    \
-       && (defined (TARGET_UNWIND_INFO)                        \
-          || (DWARF2_UNWIND_INFO                       \
-              && (defined (EH_RETURN_HANDLER_RTX)      \
-                  || defined (HAVE_eh_return))))
-#  define MUST_USE_SJLJ_EXCEPTIONS     0
-# else
-#  define MUST_USE_SJLJ_EXCEPTIONS     1
-# endif
-#endif

Note the use of HAVE_eh_return.  So this depends on target macros but
also on insn-flags.h.  So USING_SJLJ_EXCEPTIONS is does not get
defined properly.  This in turn causes __USING_SJLJ_EXCEPTIONS__ to
nto get defined properly. Now you have a broken unwind*.

The solution is, I think, to include defaults.h *after*
insn-constants.h and insn-flags.h in tm.h.

This works iff those two headers are independent of anything defined
in defaults.h.  For insn-constants.h this is obviously true. For
insn-flags.h I am not sure.

Could a build person give his/her thoughts on the following patch, please?

Ciao!
Steven


Index: mkconfig.sh
===================================================================
--- mkconfig.sh (revision 160147)
+++ mkconfig.sh (working copy)
@@ -63,6 +63,10 @@

 # The first entry in HEADERS may be auto-FOO.h ;
 # it wants to be included even when not -DIN_GCC.
+# Postpone including defaults.h until after the insn-*
+# headers, so that the HAVE_* flags are available
+# when defaults.h gets included.
+postpone_defaults_h="no"
 if [ -n "$HEADERS" ]; then
     set $HEADERS
     case "$1" in auto-* )
@@ -73,7 +77,11 @@
     if [ $# -ge 1 ]; then
        echo '#ifdef IN_GCC' >> ${output}T
        for file in "$@"; do
-           echo "# include \"$file\"" >> ${output}T
+           if test x"$file" = x"defaults.h"; then
+               postpone_defaults_h="yes"
+           else
+               echo "# include \"$file\"" >> ${output}T
+           fi
        done
        echo '#endif' >> ${output}T
     fi
@@ -94,6 +102,11 @@
     ;;
 esac

+# If we postponed including defaults.h, add the #include now.
+if test x"$postpone_defaults_h" = x"yes"; then
+    echo "# include \"defaults.h\"" >> ${output}T
+fi
+
 # Add multiple inclusion protection guard, part two.
 echo "#endif /* ${header_guard} */" >> ${output}T


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