public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amylaar at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/46500] target.h includes tm.h
Date: Tue, 23 Nov 2010 14:18:00 -0000	[thread overview]
Message-ID: <bug-46500-4-8vXRIZns8H@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46500-4@http.gcc.gnu.org/bugzilla/>

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


  reply	other threads:[~2010-11-23 13:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 16:12 [Bug middle-end/46500] New: " amylaar at gcc dot gnu.org
2010-11-23 14:18 ` amylaar at gcc dot gnu.org [this message]
2010-11-23 15:45 ` [Bug middle-end/46500] " joseph at codesourcery dot com
2010-11-24 20:12 ` amylaar at gcc dot gnu.org
2010-12-17 12:35 ` amylaar at gcc dot gnu.org
2010-12-27 12:14 ` amylaar at gcc dot gnu.org
2011-04-05 15:17 ` jsm28 at gcc dot gnu.org
2011-05-02 17:46 ` amylaar at gcc dot gnu.org
2011-05-15 13:24 ` amylaar at gcc dot gnu.org
2011-05-30 12:16 ` amylaar at gcc dot gnu.org
2011-06-16 13:46 ` amylaar at gcc dot gnu.org
2011-06-25 14:44 ` amylaar at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-46500-4-8vXRIZns8H@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).