comp.lang.ada
 help / color / mirror / Atom feed
From: Leo Brewin <leo.brewin@internode.on.net>
Subject: bug in gnatgpl 2015?
Date: Mon, 31 Aug 2015 00:34:40 -0700 (PDT)
Date: 2015-08-31T00:34:40-07:00	[thread overview]
Message-ID: <32c623ac-817e-46fc-bb13-c77b47a506a7@googlegroups.com> (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;


             reply	other threads:[~2015-08-31  7:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31  7:34 Leo Brewin [this message]
2015-08-31  8:48 ` bug in gnatgpl 2015? 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
replies disabled

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