This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/42736] [4.3/4.4/4.5 Regression] Wrong-code with allocatable compounds



------- Comment #2 from burnus at gcc dot gnu dot org  2010-01-13 22:26 -------
I think there is an off by one problem in the call to assign_lv_real; that also
matches the problem shown by gdb:

Breakpoint 2, assign_lv_real (lefthandside=Cannot access memory at address
0x1e141b0

(gdb) pt lefthandside
type = real(kind=4)
(gdb) p righthandside
$2 = ( 42 )


Looking at the dump, one finds:
    ! data.2 is memcopy of parm.1.data = table->realdata.data
    atmp.2.data = (void * restrict) data.3; 
    atmp.2.dim[0].stride = 1;
    D.1596 = -atmp.2.dim[0].stride;
      D.1598 = NON_LVALUE_EXPR <atmp.2.dim[1].stride> + D.1596;
      D.1599 = NON_LVALUE_EXPR <table->realdata.dim[1].stride> + D.1567;

         assign_lv_real (&(*(real(kind=4)[1] * restrict) atmp.2.data)[S.4 +
D.1598], &D.1601);

While table->realdata.dim[...].stride has for both [0] and [1] the stride set
to 1, atmp.2 only has "atmp2.dim[0].stride" set thus atmp.2.dim[1].stride is
either 0 or some other random value.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42736


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]