-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 26 Jan 2014 20:52:29 -0500 (EST)
Brian Davis <[email protected]> wrote:

> As a quick sanity check, I checked the patched ghdl-mcode
> against an integer divide-by-zero, instead of an index range
> out-of-bounds.
> 
> The divide-by-zero was caught by the exception handler as
> follows, with the test printf showing up along with the
> expected messages:
> 
>   C:\brian\jobs\ghdl_test\divide_by_zero>ghdl -r div_test
>   in ghdl_SEH_handler
>   exception raised: division by 0
>   c:\ghdl\ghdl-0.31-patched\bin\ghdl.exe:error: simulation
> failed
> 
> So the integer divide exceptions are being caught, which means
> the ghdl_SEH_handler is being registered.
> 
> But it would seem that the range check integer overflow
> exceptions are never making it to the ghdl_SEH_handler.
> 
> I have no idea how the GNAT/windows exception handling
> mechanisms work, so I'll have to do some research before I can
> offer any sort of sensible opinion on why that is.
> 

I don't think I actually understand the issue being discussed
in this thread but could the problem be that your Ada compiler
isn't including overflow checking code?

- From http://gcc.gnu.org/wiki/GNAT

Question:
"I understand Ada is supposed to have overflow checking for
scalar types but I wrote a test program that I expected would
generate an exception and did not get one. What happened?

Answer:
"For a variety of reasons, GNAT requires a few non-default
compiler flags to get Language Reference Manual(LRM) compliant
performance. One can debate the wisdom of this approach but it
it currently is what it is. In some cases, the default approach
that was selected by the compiler developers is "better" than
what is required by the LRM with few if any downsides. Try
invoking the gnatmake command with the following options to get
LRM compliant compiles

        gnatmake -gnato -fstack-check -gnatE my_program 

Note that in most cases one should probably not use -gnatE
(which enables LRM compliant elaboration order checking). The
GNAT default is better and does not negatively impact the
portability of your code."


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (OpenBSD)

iQIaBAEBAgAGBQJTH0jXAAoJEGUApdpiqr3gACgP725Y+Sz2jcI+njtq6fjNTZgA
SzDxASDWk5tY8mnQzJn/vjTu/GWBz6Y46Ou6KR1oS8fhxa88vFafB9nyBcKYqLut
LQlxR4MECkbVCNNqH3EAOsTfFPoE77WJtqoEGKXnYRiJRE1fKg8/lzd5gF6C++Q1
mD92Jw4g5MYIidwwcJt6it6qZtU8RwiNLoG2jw8TPV7sgKRf46yITbLM5uZosa1Z
hLfAl7vYGXGUYq4auYVDHunqsxJcrKONqdskMgSHpSXdhr3uuC1+Gdbz78m4Qz7W
4isonu7PT1N/2GS9lnXKRISwTupvJU/hXOlMq4lRccRpxzY0WysgIs3tP1V4HxpI
emlmvg4D+4ipu3Rnwi0xuOJwy+oR4UNrX6RgRhEceURniIrHABXKadlkqdZbNDiL
zwKpiDjl50/21OvirPah9eLTP622hF6pRxwm1dCZ7c4xPEy0TxQf9I2VCDKsKycK
Pngnkjk7SVbIlB+Up9j1qxqxCnE/7YCJaxv00yO5bwxN4RjxjdYOFl7NDuWbJK7V
+0PgM/kc0nE8qBnZe0DUzXt2Jt9yVRB5PxKSRVFOfwsNMn9POA2RAtC+RA+5XmoM
9nNap1wZGugkIZJAnoySyIvdEqZUTX04+zR5kZi06Kb6UoRlU6nyQLe4+EMHCYiT
w+ixlFYifWDHIht3sg==
=ndq8
-----END PGP SIGNATURE-----

_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to