comp.lang.ada
 help / color / mirror / Atom feed
* bug in gnatgpl 2015?
@ 2015-08-31  7:34 Leo Brewin
  2015-08-31  8:48 ` Simon Wright
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Leo Brewin @ 2015-08-31  7:34 UTC (permalink / raw)


Greetings,

I've run into what I think is a bug in gnatgpl 2015.
I wonder if others could confirm the bug?

I've tried to make the code as short as possible while still
capturing the alleged bug.

Using gnatgpl 2015 from Adacore, I get

   gnatmake crash.adb

      gcc -c crash.adb

      raised CONSTRAINT_ERROR : erroneous memory access
      gnatmake: "crash.adb" compilation error

and on occassions a detailed report (too long to include here but will
be sent to Adacore if need be).

I get no problems when using Simon's gcc-5.1.0 compiler.

I'm using MacOSX 10.10.5 with the command line tools from Xcode 6.4.

Cheers,
Leo

Here are the two packages,
   crash.adb/crash.ads
   simplex.adb/simplex.ads

-- crash.ads --------------------------
   package crash is
      procedure foo;
   end crash;

-- crash.adb --------------------------
   with simplex;

   package body crash is

      package std_lattice is new Simplex (n_head_max => 50);

      use std_lattice;

      procedure foo is
      begin
         null;
      end foo;

   end crash;

-- simplex.ads ------------------------
   generic

      n_head_max : Integer := 5;

   package Simplex is

      procedure deallocate;
      type myArray1dIntg is array (Integer range <>) of Integer;
      type myArray1dIntg_ptr is access myArray1dIntg;

   private

      head_ptr : myArray1dIntg_ptr := new myArray1dIntg (0 .. 1);

      head     : myArray1dIntg renames head_ptr.all;

   end Simplex;

-- simplex.adb ------------------------
   package body Simplex is

      procedure deallocate is
      begin
         null;
      end deallocate;

      procedure clear is
      begin
         head (1) := 1;
      end clear;

      procedure add is
      begin
         head (1) := 1;
      end add;

   end Simplex;


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-09-10  7:31 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-31  7:34 bug in gnatgpl 2015? Leo Brewin
2015-08-31  8:48 ` Simon Wright
2015-08-31  9:19   ` Leo Brewin
2015-08-31 10:51     ` Peter Chapin
2015-08-31 15:54       ` Anh Vo
2015-08-31 23:33         ` Anh Vo
2015-08-31 23:37           ` Leo Brewin
2015-08-31 23:55             ` Leo Brewin
2015-08-31 23:35 ` Leo Brewin
2015-09-01  0:33 ` Leo Brewin
2015-09-01  1:24   ` Anh Vo
2015-09-01 12:42     ` Simon Wright
2015-09-01  7:44   ` Markus Schöpflin
2015-09-01  9:17   ` G.B.
2015-09-01 13:43 ` ahlan
2015-09-01 13:45 ` ahlan
2015-09-10  7:31   ` Jerry van Dijk

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