This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Re: Your addition of BT_SSIZE
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Paul Brook <paul at nowt dot org>, Steven Bosscher <s dot bosscher at student dot tudelft dot nl>, Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Tue, 19 Aug 2003 12:26:10 -0400
- Subject: Re: [PATCH] Re: Your addition of BT_SSIZE
- Organization: Red Hat Canada
- References: <Pine.LNX.4.44.0308182227130.22816-100000@www.eyesopen.com>
On Tue, 2003-08-19 at 00:56, Roger Sayle wrote:
> Hi Diego,
> > Is builtin-types.def supposed to be language independent? If so, could
> > you redefine BT_SSIZE so that it doesn't depend on c-tree.h?
>
> My personal opinion is that builtin-types.def clearly isn't language
> independent, and trying to pretend that it is doesn't help. "The first
> step is admiting you have a problem". To quote Zack's GCC Developer
> Summit paper:
>
> >> For instance, the Java front end has interesting kludges in it
> >> to cope with the allegedly language-independent builtins.def, which
> >> is full of C-specific notions like va_list.
>
> To this end, I've managed to remove builtins.def from the f77 and java
> front-ends, whilst improving intrinsic support. Unfortunately, the
> fortran 95 seems to have escaped the code clean-up and contains such
> interesting kludges as
>
> >> #define flag_isoc99 0
>
>
> Fortunately, I also appreciate your predicament as branch maintainer.
> The following patch exposes signed_size_type_node outside of the C-family
> front-ends as a short-term solution. Correcting how g95 defines fortran
> intrinsics and C's builtins can wait until tree-ssa gets merged. For
> example, because g95 currently ignores attributes such as "const", it
> may generate worse code than g77 for expressions involving SQRT, EXP,
> etc... Similarly, I doubt that fprintf or even __builtin_eh_return make
> much sense when called directly from FORTRAN (but I may be wrong). The
> following patch should atleast allow a merged tree-ssa branch to compile.
>
Thanks Roger, but unfortunately, it wasn't enough. The problem is that
signed_size_type_node is built by c-common.c with a call to
c_common_signed_type. What happens at runtime is that we ICE in
build_function_type because in f951 signed_size_type_node is NULL.
Making the Fortran FE initialize this would cause even more C-isms to
leak into it. I don't think we want that. Paul, I think we should
probably fix this in f95-lang.c, but I don't know how.
Suggestions?
Thanks. Diego.