[Bug middle-end/46500] target.h includes tm.h
amylaar at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Nov 23 14:18:00 GMT 2010
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46500
Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
Severity|normal |major
--- Comment #1 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2010-11-23 13:59:25 UTC ---
The conclusion of the previous discussion about the inappropriateness of
target hooks taking target-dependent types like CUMULATIVE_ARGS or
CUMULATIVE_ARGS * was to convert to void * after initial hookization:
http://gcc.gnu.org/ml/gcc-patches/2010-06/msg02607.html
I have posted a patch that does just that:
http://gcc.gnu.org/ml/gcc-patches/2010-11/msg01769.html
but in the parallel discussion on the GCC mailing list there was now
resistance against using void pointers and casts in general, as can be
seen in the replies to this message:
http://gcc.gnu.org/ml/gcc/2010-11/msg00385.html
Nathan Froyd, who had before vigorously propagated the offending hooks, now
proposed to put the target-dependent function pointers in a place outside
of targetm for a C++ based solution:
http://gcc.gnu.org/ml/gcc/2010-11/msg00413.html
In response to this, I've posted a patch proposal that moved the offending
hooks out of targetm into a separate vector that is not needed by
target-independent code:
http://gcc.gnu.org/ml/gcc-patches/2010-11/msg01810.html
I also noted that this patch, although conceptually very simple, was
largish because of all the target hook sites changed. I proposed a
strategy how have a set of smaller patches by first making the hooks
easier to move around:
http://gcc.gnu.org/ml/gcc/2010-11/msg00455.html
, but that was met with disapproval.
One thing that came out of this discussion, though, was an apparent
agreement that casts would be acceptable if kept in a few small functions
that implement type conversions, as long as the bulk of the code was
type-safe. Although the initial proposal missed the point of defining
a target-independent type, we eventually got something that provides
type-safety hook using code using a target-independent type:
http://gcc.gnu.org/ml/gcc/2010-11/msg00479.html
I then posted an update of the first (void * based) patch that
encapsulated the void * in a struct or union:
http://gcc.gnu.org/ml/gcc-patches/2010-11/msg01994.html
I noted that a problem with the patch was its sheer size, which might
make it hard to get all of it reviewed, so I also posted a variant with
the target-independent / dependent changes separated, using a bit of
extra Makefile logic and fall-back code in target.h so that un-converted
targets could continue to function for a transitory period.
http://gcc.gnu.org/ml/gcc-patches/2010-11/msg02284.html
So, to summarize, I made two alternative proposals how to solve the problem:
- Alternative 1:
Change the hooks so that they are suitable for a target-independent hook
vector.
We can do this either in one mega-patch if we get a hero reviewer:
http://gcc.gnu.org/ml/gcc-patches/2010-11/msg01994.html
or do the target-independent stuff first, and then review the target
dependent code either one-by-one or in group(s):
http://gcc.gnu.org/ml/gcc-patches/2010-11/msg02284.html
- Alternative 2:
Move the hooks with target-dependent types out of targetm:
http://gcc.gnu.org/ml/gcc-patches/2010-11/msg01810.html
More information about the Gcc-bugs
mailing list