comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: My first compiler bug: work around or redesign?
Date: Sat, 24 Mar 2012 01:04:08 +0100
Date: 2012-03-24T01:04:08+01:00	[thread overview]
Message-ID: <4f6d0f78$0$6623$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <slrnjmprdv.1lme.lithiumcat@sigil.instinctive.eu>

On 23.03.12 22:40, Natasha Kerensikova wrote:
> On 2012-03-23, Robert A Duff<bobduff@shell01.TheWorld.com>  wrote:
>> "Dmitry A. Kazakov"<mailbox@dmitry-kazakov.de>  writes:
>>
>>> First, make sure your code is legal. In some cases GNAT crashes when
>>> detects an error in the program. One method to find the problem is to
>>> comment offending source code lines until it compiles and then twist it
>>> this or that way.
>>
>> It's easier to use the -gnatdO switch, which is documented
>> in debug.adb.
>
> I tried compiling my code with that extra flag, and I got exactly the
> same error output.
>
> I don't know really know what conclusion to draw from there.

A bug seems present, with or without switches, in GNAT GPL 2011/Mac, too.

+===========================GNAT BUG DETECTED==============================+
| GPL 2011 (20110419) (x86_64-apple-darwin10.2.0) GCC error:               |
| in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:4121                  |
| Error detected at dressup-parsers-markdown.adb:184:4 [dressup-parsers-markdown.adb:1651:7 [markdown.adb:32:4]]|

 From the looks of it, it seems there is a probability that
the bug is related to passing information between GNAT
and other parts of GCC. The rest is speculation by mere mortals :-)


I worked around by adding switch -gnat95 and then mechanically following
the compiler's complaints. Less than I did might do the trick, though,
with GNAT at least, or any compiler that accepts Ada 2005 from the RTS in
Ada 95 programs.

http://home.arcor.de/bauhaus/Ada/Dressup-bf54531f8dcf7117.diff

(A huge fraction of the patch is just syntax.)


I have let warnings about Ada.Containers (being 2005) be warnings.
The same relaxed attitude might work with GNAT and the new Strings.Fixed,
the one with the From parameter.

I seem not to have changed the generics part which you have been mentioning.
Moreover, I have added generics where procedures such as Iterate require
anonymous subprogram pointers now---no fancy downwards closures needed
here, though, and simple instantiations would do.

The resulting executable bin/markdown does output HTML for
*, \n==, etc., but I'm not sure that I have been sufficiently meticulous.
(Is bin/markdown supposed to successfully run a test suite yet?
I found test cases in something called MarkdownTest_1.0.zip,
which has a driver program written in Perl in it. I haven't used
it directly, but fed Tests/Tabs.text from this distribution
to bin/markdown and compared the results, just to see if I hadn't
messed up).




  reply	other threads:[~2012-03-24  0:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23 16:29 My first compiler bug: work around or redesign? Natasha Kerensikova
2012-03-23 17:51 ` Ludovic Brenta
2012-03-23 21:20   ` Natasha Kerensikova
2012-03-23 17:56 ` Jeffrey Carter
2012-03-23 18:22 ` Jeffrey Carter
2012-03-23 21:23   ` Natasha Kerensikova
2012-03-23 22:54     ` Jeffrey Carter
2012-03-23 18:29 ` Simon Wright
2012-03-23 18:37 ` Dmitry A. Kazakov
2012-03-23 18:48   ` Robert A Duff
2012-03-23 21:40     ` Natasha Kerensikova
2012-03-24  0:04       ` Georg Bauhaus [this message]
2012-03-24  9:50         ` Natasha Kerensikova
2012-03-23 21:34   ` Natasha Kerensikova
2012-03-23 19:04 ` Jeffrey Carter
2012-03-26 18:15 ` Natasha Kerensikova
2012-03-26 18:43   ` Simon Wright
2012-03-26 18:55   ` Ludovic Brenta
2012-03-28 15:30     ` Natasha Kerensikova
2012-03-29  8:25       ` Ludovic Brenta
2012-03-30 23:42         ` onox
2012-04-02 20:51           ` Ludovic Brenta
2012-04-03  2:50             ` onox
2012-03-26 21:47   ` Georg Bauhaus
2012-03-27  5:34     ` Per Sandberg
2012-03-27  7:30     ` Dmitry A. Kazakov
replies disabled

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