[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-03-14 Thread vehre at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

vehre at gcc dot gnu.org changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #16 from vehre at gcc dot gnu.org ---
No complaints so far, closing.

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-02-26 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

--- Comment #15 from Dominik Vogt  ---
The problem is gone on today's trunk for s390 and s390x.

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-02-23 Thread vehre at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

--- Comment #14 from vehre at gcc dot gnu.org ---
Author: vehre
Date: Tue Feb 23 10:29:26 2016
New Revision: 233625

URL: https://gcc.gnu.org/viewcvs?rev=233625&root=gcc&view=rev
Log:
gcc/testsuite/ChangeLog:

2016-02-23  Andre Vehreschild  

PR fortran/67451
* gfortran.dg/coarray_allocate_5.f08: New test.


gcc/fortran/ChangeLog:

2016-02-23  Andre Vehreschild  

PR fortran/67451
* trans-array.c (gfc_array_allocate): Take the attributes from the
expression to allocate and not from the source=-expression.


Added:
trunk/gcc/testsuite/gfortran.dg/coarray_allocate_5.f08
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-array.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-02-10 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

--- Comment #13 from Dominique d'Humieres  ---
The patch fixes the two issues I saw on x86_64-apple-darwin15 (comment 10 and
an ICE when compiling the test with -fcoarray=lib).

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-02-10 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

--- Comment #12 from Dominik Vogt  ---
The patch works on s390x.

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-02-10 Thread vehre at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

--- Comment #11 from vehre at gcc dot gnu.org ---
Patch at:

https://gcc.gnu.org/ml/fortran/2016-02/msg00033.html

Waiting for review and approval of bugreporters whether the patch fixes the
issue or not.

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-02-09 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

--- Comment #10 from Dominique d'Humieres  ---
> gfortran.dg/coarray_allocate_3.f08 crashed with an invalid free()
> on s390 and s390x.

If the test is compiled with -fsanitize=address, I get

==19013==ERROR: AddressSanitizer: global-buffer-overflow on address
0x00010ef2e1d8 at pc 0x00010ef2d1dd bp 0x7fff50cd32f0 sp 0x7fff50cd32e8
WRITE of size 8 at 0x00010ef2e1d8 thread T0
#0 0x10ef2d1dc in MAIN__ (a.out+0x111dc)
#1 0x10ef2d79e in main (a.out+0x1179e)
#2 0x7fff8c7695ac in start (libdyld.dylib+0x35ac)
#3 0x0  ()

0x00010ef2e1d8 is located 0 bytes to the right of global variable
'some_local_object' defined in
'/opt/gcc/_clean/gcc/testsuite/gfortran.dg/coarray_allocate_3.f08:15'
(0x10ef2e1a0) of size 56
SUMMARY: AddressSanitizer: global-buffer-overflow (a.out+0x111dc) in MAIN__
Shadow bytes around the buggy address:
  0x100021de5be0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100021de5bf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100021de5c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100021de5c10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9
  0x100021de5c20: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 f9 f9
=>0x100021de5c30: f9 f9 f9 f9 00 00 00 00 00 00 00[f9]f9 f9 f9 f9
  0x100021de5c40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100021de5c50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100021de5c60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100021de5c70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100021de5c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
...

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-02-09 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

--- Comment #9 from Dominik Vogt  ---
I.e. free(0x1) is called:

Load foobar.1497 to r12

   0x8998 <+40>:larl%r12,0x80002408 

   (gdb) p /x $r12
   0x80002408

First malloc call, store mem pointer in foobar.1497

   0x89c6 <+86>:brasl   %r14,0x8788 
   0x89cc <+92>:stg %r2,0(%r12)

Second malloc call, store mem pointer in some_local_object.1511

   0x8ae8 <+376>:   brasl   %r14,0x8788 
   0x8aee <+382>:   stgrl   %r2,0x800023d0 

Load address of some_local_object.1511 to r1

   0x8afa <+394>:   larl%r1,0x800023d0 

Write something to r1 + 16, r1 + 32, r1 + 40, r1 + 24

   0x8b00 <+400>:   mvghi   16(%r1),297
   0x8b06 <+406>:   stg %r11,32(%r1)
   0x8b0c <+412>:   stg %r8,40(%r1)
   0x8b12 <+418>:   mvghi   24(%r1),1

This overwrites foobar.1497 with the value 1:

   0x8b18 <+424>:   mvghi   56(%r1),1

   (gdb) p /x $r1 + 56
   0x80002408   <-- address of foobar.1497

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-02-09 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

Dominik Vogt  changed:

   What|Removed |Added

 CC||vogt at linux dot vnet.ibm.com

--- Comment #8 from Dominik Vogt  ---
gfortran.dg/coarray_allocate_3.f08 crashed with an invalid free() on s390 and
s390x.

(gdb) run
Starting program: .../gcc/build/gcc/testsuite/coarray_allocate_3.exe 

Program received signal SIGSEGV, Segmentation fault.
0x03fff7cb6814 in free () from /lib64/libc.so.6
(gdb) bt
#0  0x03fff7cb6814 in free () from /lib64/libc.so.6
#1  0x8cae in MAIN__ ()
at .../gcc/testsuite/gfortran.dg/coarray_allocate_3.f08:26
#2  main (argc=, argv=)
at .../gcc/testsuite/gfortran.dg/coarray_allocate_3.f08:27
#3  0x03fff7c4e0a2 in __libc_start_main () from /lib64/libc.so.6
#4  0x8866 in _start ()

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-02-03 Thread vehre at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

--- Comment #7 from vehre at gcc dot gnu.org ---
Commited fix; waiting one week for error reports before closing.

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-02-03 Thread vehre at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

--- Comment #6 from vehre at gcc dot gnu.org ---
Author: vehre
Date: Wed Feb  3 10:39:09 2016
New Revision: 233101

URL: https://gcc.gnu.org/viewcvs?rev=233101&root=gcc&view=rev
Log:
gcc/testsuite/ChangeLog:

2016-02-03  Andre Vehreschild  

PR fortran/67451
PR fortran/69418
* gfortran.dg/coarray_allocate_2.f08: New test.
* gfortran.dg/coarray_allocate_3.f08: New test.
* gfortran.dg/coarray_allocate_4.f08: New test.


gcc/fortran/ChangeLog:

2016-02-03  Andre Vehreschild  

PR fortran/67451
PR fortran/69418
* trans-expr.c (gfc_copy_class_to_class): For coarrays just the
pointer is passed.  Take it as is without trying to deref the
_data component.
* trans-stmt.c (gfc_trans_allocate): Take care of coarrays as
argument to source=-expression.


Added:
trunk/gcc/testsuite/gfortran.dg/coarray_allocate_2.f08
trunk/gcc/testsuite/gfortran.dg/coarray_allocate_3.f08
trunk/gcc/testsuite/gfortran.dg/coarray_allocate_4.f08
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans-stmt.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-02-03 Thread vehre at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

--- Comment #5 from vehre at gcc dot gnu.org ---
Author: vehre
Date: Wed Feb  3 09:44:18 2016
New Revision: 233099

URL: https://gcc.gnu.org/viewcvs?rev=233099&root=gcc&view=rev
Log:
gcc/testsuite/ChangeLog:

2016-02-03  Andre Vehreschild  

PR fortran/67451
PR fortran/69418
* gfortran.dg/coarray_allocate_2.f08: New test.
* gfortran.dg/coarray_allocate_3.f08: New test.
* gfortran.dg/coarray_allocate_4.f08: New test.


gcc/fortran/ChangeLog:

2016-02-03  Andre Vehreschild  

PR fortran/67451
PR fortran/69418
* trans-expr.c (gfc_copy_class_to_class): For coarrays just the
pointer is passed.  Take it as is without trying to deref the
_data component.
* trans-stmt.c (gfc_trans_allocate): Take care of coarrays as
argument to source=-expression.


Added:
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/coarray_allocate_2.f08
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/coarray_allocate_3.f08
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/coarray_allocate_4.f08
Modified:
branches/gcc-5-branch/gcc/fortran/ChangeLog
branches/gcc-5-branch/gcc/fortran/trans-expr.c
branches/gcc-5-branch/gcc/fortran/trans-stmt.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug fortran/67451] [5/6 Regression] [F08] ICE with sourced allocation from coarray.

2016-02-01 Thread vehre at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67451

vehre at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|WAITING

--- Comment #4 from vehre at gcc dot gnu.org ---
Patch for trunk:

https://gcc.gnu.org/ml/fortran/2016-01/msg00093.html

"Backported" patch for gcc-5:

https://gcc.gnu.org/ml/fortran/2016-02/msg1.html

Waiting for reviews.