comp.lang.ada
 help / color / mirror / Atom feed
From: "Vincent MORIN" <vincent.morin@univ-brest.fr>
Subject: Re: Looking in Gnat gnu Backend
Date: Fri, 16 Nov 2001 10:51:06 +0100
Date: 2001-11-16T09:47:24+00:00	[thread overview]
Message-ID: <9t2nbc$km4$1@melon.univ-brest.fr> (raw)
In-Reply-To: 9t2ktd$o7t$1@suaar1aa.prod.compuserve.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3188 bytes --]

     Hello Michael,

     In the forum, some people are talking about AdaOS, but nobody saw any
serious source, it is a shame, but so it is.
     On my own side I rewrote a Mac like OS in Pascal and now translating it
in Ada (see sx-ada-kalinda at sourceforge.net). I am an old Ada 83 adept
from the eighties", but at the time people around me in the lab I worked in
nearly wanted to kick me out for heresy in promoting Ada (the C talibans
? ).
     Ada has built in features which classically pertain to OS (tasking,
time management and some other utilities. So for an OS in Ada, the
compiler-OS integration is a more pregnant question than in other languages
as Pascal.
     I thus try to understand, specialize and modifiy the Gnat chain to
insert it in the OS (compiler working with kalinda's memory management, some
constraints removed as forced style for runtime sources, and a simplified
adapted runtime).
     Of course, if you take gcc 2.8.1 and gnat, rebuilding is a heavy
process as gcc is #define written for all machines of the universe (so that
if you miss a define generally something goes wrong even with auto config).
     So more problems you get if you want to withdraw gnat from gcc toplevel
to have a standalone ada to asm translater with autonomous command line
prompting. I relinked an extracted C+Ada source version and linked it ok
with linker options pragmas put in the backed.adb. As I have executions
problems in the backend after gigi (types with size zero or things like
that) I translated some C routines in Ada working on RTL ada redefined
structures. With ada "for TheType Use Record.." you can progressively and
selectively access rtl structures with Ada templates, they are easier to gdb
debug than C structures with unions and multiple usage flags.
     At this occasion I saw how gcc is written, I find it properly awful :
just take the (simple) force_fit_type function in fold_const.c, it has a
conditioned condition which takes10 mn at least to understand :

 /* If the value's sign bit is set, extend the sign.  */
  if (prec != 2 * HOST_BITS_PER_WIDE_INT
      && (prec > HOST_BITS_PER_WIDE_INT
   ? (TREE_INT_CST_HIGH (t)
      & ((HOST_WIDE_INT) 1 << (prec - HOST_BITS_PER_WIDE_INT - 1)))
   : TREE_INT_CST_LOW (t) & ((HOST_WIDE_INT) 1 << (prec - 1))))
    {
  }

just to extract the sign of a 64 bits quantity in two 32 bits chunks with
two cases function of the prec number of bits. The Ada equivalent is much
easier to read !

All the rest of gcc is of the same flavour ; it is an extraterrestrial
software engineering.

VMO



Michael Garrett <michaelgarrett@csi.com> a �crit dans le message :
9t2ktd$o7t$1@suaar1aa.prod.compuserve.com...
> Out of curiosity what are you modifying??
>
> Michael
>
>
> Vincent MORIN <vincent.morin@univ-brest.fr> wrote in message
> news:9t0qsh$2am$1@melon.univ-brest.fr...
> >     Hello Ada'ists,
> >
> >     I try to reconnect and modify the gnu backend behind gnat. Looking
> > inside gcc backend I only have a question :
> >
> >     HAS IT BEEN WRITTEN BY HUMANS ?
> >
> >     The difference between C and Ada is that the latter is a human
> > expression, but the first ?
> >
> >     VMO
> >
> >
>
>





      reply	other threads:[~2001-11-16  9:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-15 16:39 Looking in Gnat gnu Backend Vincent MORIN
2001-11-16  9:03 ` Michael Garrett
2001-11-16  9:51   ` Vincent MORIN [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox