[PATCH] Re: Your addition of BT_SSIZE

Diego Novillo dnovillo@redhat.com
Tue Aug 19 16:26:00 GMT 2003


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.



More information about the Gcc-patches mailing list