[Patch, Fortran] Component declarations overwrite types of Cray Pointee variables
Fritz Reese
fritzoreese@gmail.com
Fri Sep 5 14:28:00 GMT 2014
On Fri, Sep 5, 2014 at 9:15 AM, Dominique Dhumieres <dominiq@lps.ens.fr> wrote:
> On x86_64-apple-darwin13 running the test gcc/testsuite/gfortran.dg/cray_pointers_11.f90
> gives 'Program received signal SIGSEGV: Segmentation fault - invalid memory reference.'
>
> Is the code valid Fortran with the cray-pointer extension? If yes, the commit has replaced
> a reject-valid with wrong-code. If no, why? what is missing to make the code valid?
> and why this is not detected?
>
> Note that I have never used, and will never use, the cray-pointer extension.
>
> TIA
>
> Dominique
cray_pointers_11.f90 tests the compiler frontend and should not be
executed. Your test framework is broken or misused if it is executing
this test (see { dg-do compile } in the header comments).
The code is expected to segfault if executed; declaring x/x_ptr only
sets the base type of x_ptr to that of x and gives a means by which to
dereference x_ptr. No space for a type t1 is actually reserved. The
test is similar to the following C code:
struct t1 { integer i; } *x;
x->i = 0
---
Fritz Reese
More information about the Fortran
mailing list