comp.lang.ada
 help / color / mirror / Atom feed
* bug compiler ?
@ 2017-06-30  8:49 bbaborum
  2017-06-30 11:09 ` Lucretia
  2017-06-30 15:11 ` AdaMagica
  0 siblings, 2 replies; 10+ messages in thread
From: bbaborum @ 2017-06-30  8:49 UTC (permalink / raw)


Hello everyone,

I tried to compile this 

procedure bug is
	type my_int is new integer;
	type access_function_my_int is access function (n : my_int) return my_int;
	function f (n : my_int) return my_int is (n);
	a : access_function_my_int :=f'access;
begin
	null;
end bug;

with the command line : gcc -c -gnat2012 bug.adb

and then I get this message from the compiler:


raised STORAGE_ERROR : stack overflow or erroneous memory access

If I modify the type "my_int" by writing subtype my_int is integer;
then I dont get any error from the compiler.

More interesting, if in the first program, the function f is no longer written inline, then I dont get any error.

Does anyone know what's happeing ?	

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

end of thread, other threads:[~2017-07-02 16:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30  8:49 bug compiler ? bbaborum
2017-06-30 11:09 ` Lucretia
2017-06-30 14:49   ` Anh Vo
2017-06-30 15:03     ` Anh Vo
2017-06-30 18:47     ` Simon Wright
2017-06-30 19:42       ` Anh Vo
2017-07-02 16:43       ` bbaborum
2017-07-02 16:42   ` bbaborum
2017-06-30 15:11 ` AdaMagica
2017-06-30 18:20   ` Randy Brukardt

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