From: Georg Bauhaus on
(see below) schrieb:

> That works very nicely, and, unlike the other SL compilers I've tried
> previously, code compiled with inlining at -O3 does not malfunction
> (on the two major test cases I've tried so far, anyway).

FWIW, when we tried to find the best options for the Shootout
programs, it turned out that -gnatn -O2 -funroll-loops was
about as good as -O3. Sometimes the results were even faster.
From: sjw on
On Dec 23, 3:29 am, "(see below)" <yaldni...(a)blueyonder.co.uk> wrote:
> On 22/12/2009 23:37, in article
> 96854a61-2032-49b1-a8b2-8a5aee181...(a)22g2000yqr.googlegroups.com, "sjw"
>
> <simon.j.wri...(a)mac.com> wrote:
> > Have just uploaded gnat-gpl-2009-i386-apple-darwin10.2.0-1.tar.bz2,
> > without the dependency; will remove the offending files after a day or
> > two.
>
> Unfortunately, it goes very badly wrong at -O1 optimization level on another
> example:
>
> --------------------------------------------------------------------------- -
> package test is
>    type i64 is mod 2**64;
>    for  i64'Size use 64;
>    subtype a_virtual_address is i64;
>    subtype an_offset is a_virtual_address;
>
>    function fetch_byte_from (
>          location : i64;
>          position : an_offset )
>    return i64;
> end test;
> --
> package body test is
>    type i08 is mod 2**8;
>    for  i08'Size use 8;
>    type an_i08_array is array (a_virtual_address range <>) of i08;
>    for  an_i08_array'Component_Size use i08'Size;
>    type an_i08_group is new an_i08_array (0..7);
>    for  an_i08_group'Size use i64'Size;
>    pragma Convention (C, an_i08_group);
>
>    function fetch_byte_from (
>          location : i64;
>          position : an_offset )
>    return i64 is
>       the_location_as_i08s : an_i08_group;
>       for the_location_as_i08s'Address use location'Address;
>       pragma Import (Ada, the_location_as_i08s);
>    begin
>       return i64(the_location_as_i08s
>                   ((position and 2#111#) xor 2#111#));
>    end fetch_byte_from;
> end test;
> --------------------------------------------------------------------------- -
>
> thus:
>
> +===========================GNAT BUG DETECTED==============================+
> | GPL 2009 (20090519) (i386-apple-darwin10.2.0) GCC error:                 |
> | in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:312                   |
> | Error detected at test.adb:14:7                                          |
> ...
>
> This error message does not appear at -O3, but the generated object program
> is non-functional, although that may be for a different reason, of course..
>
> This code compiled and ran correctly under the Leopard compilers I was using
> until I stupidly installed SL.
>
> What on earth has happened for GNAT to regress so badly in the face of what
> is often described as a tidying-up and performance release of OS X?

I don't know either, because here it compiles without complaint at -O
{0,1,2,3}!
From: Jerry on
On Dec 22, 8:29 pm, "(see below)" <yaldni...(a)blueyonder.co.uk> wrote:
> On 22/12/2009 23:37, in article
> 96854a61-2032-49b1-a8b2-8a5aee181...(a)22g2000yqr.googlegroups.com, "sjw"
>
> <simon.j.wri...(a)mac.com> wrote:
> > Have just uploaded gnat-gpl-2009-i386-apple-darwin10.2.0-1.tar.bz2,
> > without the dependency; will remove the offending files after a day or
> > two.
>
> Unfortunately, it goes very badly wrong at -O1 optimization level on another
> example:
>
> --------------------------------------------------------------------------- -
> package test is
>    type i64 is mod 2**64;
>    for  i64'Size use 64;
>    subtype a_virtual_address is i64;
>    subtype an_offset is a_virtual_address;
>
>    function fetch_byte_from (
>          location : i64;
>          position : an_offset )
>    return i64;
> end test;
> --
> package body test is
>    type i08 is mod 2**8;
>    for  i08'Size use 8;
>    type an_i08_array is array (a_virtual_address range <>) of i08;
>    for  an_i08_array'Component_Size use i08'Size;
>    type an_i08_group is new an_i08_array (0..7);
>    for  an_i08_group'Size use i64'Size;
>    pragma Convention (C, an_i08_group);
>
>    function fetch_byte_from (
>          location : i64;
>          position : an_offset )
>    return i64 is
>       the_location_as_i08s : an_i08_group;
>       for the_location_as_i08s'Address use location'Address;
>       pragma Import (Ada, the_location_as_i08s);
>    begin
>       return i64(the_location_as_i08s
>                   ((position and 2#111#) xor 2#111#));
>    end fetch_byte_from;
> end test;
> --------------------------------------------------------------------------- -
>
> thus:
>
> +===========================GNAT BUG DETECTED==============================+
> | GPL 2009 (20090519) (i386-apple-darwin10.2.0) GCC error:                 |
> | in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:312                   |
> | Error detected at test.adb:14:7                                          |
> ...
>
> This error message does not appear at -O3, but the generated object program
> is non-functional, although that may be for a different reason, of course..
>
> This code compiled and ran correctly under the Leopard compilers I was using
> until I stupidly installed SL.
>
> What on earth has happened for GNAT to regress so badly in the face of what
> is often described as a tidying-up and performance release of OS X?
>
> --
> Bill Findlay
> <surname><forename> chez blueyonder.co.uk

I thought OS X was officially supported by AdaCore. From the viewpoint
of a casual bystander, it looks like someone is asleep at the wheel.
This isn't support that I can believe in.

Jerry
From: sjw on
On Dec 23, 9:16 pm, Jerry <lancebo...(a)qwest.net> wrote:
> On Dec 22, 8:29 pm, "(see below)" <yaldni...(a)blueyonder.co.uk> wrote:
>
>
>
>
>
> > On 22/12/2009 23:37, in article
> > 96854a61-2032-49b1-a8b2-8a5aee181...(a)22g2000yqr.googlegroups.com, "sjw"
>
> > <simon.j.wri...(a)mac.com> wrote:
> > > Have just uploaded gnat-gpl-2009-i386-apple-darwin10.2.0-1.tar.bz2,
> > > without the dependency; will remove the offending files after a day or
> > > two.
>
> > Unfortunately, it goes very badly wrong at -O1 optimization level on another
> > example:
>
> > --------------------------------------------------------------------------- -
> > package test is
> >    type i64 is mod 2**64;
> >    for  i64'Size use 64;
> >    subtype a_virtual_address is i64;
> >    subtype an_offset is a_virtual_address;
>
> >    function fetch_byte_from (
> >          location : i64;
> >          position : an_offset )
> >    return i64;
> > end test;
> > --
> > package body test is
> >    type i08 is mod 2**8;
> >    for  i08'Size use 8;
> >    type an_i08_array is array (a_virtual_address range <>) of i08;
> >    for  an_i08_array'Component_Size use i08'Size;
> >    type an_i08_group is new an_i08_array (0..7);
> >    for  an_i08_group'Size use i64'Size;
> >    pragma Convention (C, an_i08_group);
>
> >    function fetch_byte_from (
> >          location : i64;
> >          position : an_offset )
> >    return i64 is
> >       the_location_as_i08s : an_i08_group;
> >       for the_location_as_i08s'Address use location'Address;
> >       pragma Import (Ada, the_location_as_i08s);
> >    begin
> >       return i64(the_location_as_i08s
> >                   ((position and 2#111#) xor 2#111#));
> >    end fetch_byte_from;
> > end test;
> > --------------------------------------------------------------------------- -
>
> > thus:
>
> > +===========================GNAT BUG DETECTED==============================+
> > | GPL 2009 (20090519) (i386-apple-darwin10.2.0) GCC error:                 |
> > | in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:312                   |
> > | Error detected at test.adb:14:7                                          |
> > ...
>
> > This error message does not appear at -O3, but the generated object program
> > is non-functional, although that may be for a different reason, of course.
>
> > This code compiled and ran correctly under the Leopard compilers I was using
> > until I stupidly installed SL.
>
> > What on earth has happened for GNAT to regress so badly in the face of what
> > is often described as a tidying-up and performance release of OS X?
>
> > --
> > Bill Findlay
> > <surname><forename> chez blueyonder.co.uk
>
> I thought OS X was officially supported by AdaCore. From the viewpoint
> of a casual bystander, it looks like someone is asleep at the wheel.
> This isn't support that I can believe in.

Mac OS X is indeed supported by AdaCore. But we, the users of GNAT
GPL, are *not*.

I have taken the source code provided by AdaCore in GNAT GPL 2009
about 9 months before Snow Leopard was released to the world and
rebuilt it with one change (caused by Apple's removal of sigreturn()).

I don't know any of AdaCore's customers who are supported on Mac OS X
so I can't say what AdaCore's advice to them has been; possibly those
customers who mustmustmust upgrade have been provided with wavefronts.
From: sjw on
On Dec 23, 5:18 pm, "(see below)" <yaldni...(a)blueyonder.co.uk> wrote:
> On 23/12/2009 14:26, in article
> 68e6e09a-9f02-4fd4-a87c-d1c43dd10...(a)27g2000yqr.googlegroups.com, "sjw"
> <simon.j.wri...(a)mac.com> wrote:
> > On Dec 23, 3:29 am, "(see below)" <yaldni...(a)blueyonder.co.uk> wrote:
[...]
> >> What on earth has happened for GNAT to regress so badly in the face of what
> >> is often described as a tidying-up and performance release of OS X?
>
> > I don't know either, because here it compiles without complaint at -O
> > {0,1,2,3}!
>
> Hmm. Interesting ...
> What could account for the difference?
> Do you have any other versions of GNAT installed in that testing
> environment?

Several! though I'd be surprised if any of them got invoked. Will
check further.