From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28258 invoked by alias); 23 Nov 2010 13:59:57 -0000 Received: (qmail 28244 invoked by uid 22791); 23 Nov 2010 13:59:55 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 23 Nov 2010 13:59:50 +0000 From: "amylaar at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/46500] target.h includes tm.h X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: patch X-Bugzilla-Severity: major X-Bugzilla-Who: amylaar at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Keywords Severity Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 23 Nov 2010 14:18:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-11/txt/msg02851.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46500 Jorn Wolfgang Rennecke changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch Severity|normal |major --- Comment #1 from Jorn Wolfgang Rennecke 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