[Bug fortran/83823] [8 Regression] Character length issues with PACK()

2018-02-20 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83823

Thomas Koenig  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Thomas Koenig  ---
Fixed, closing.

[Bug fortran/83823] [8 Regression] Character length issues with PACK()

2018-02-20 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83823
Bug 83823 depends on bug 48890, which changed state.

Bug 48890 Summary: [F95] Wrong length of a character component of named 
constant derived-type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48890

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug fortran/83823] [8 Regression] Character length issues with PACK()

2018-02-20 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83823

--- Comment #5 from Thomas Koenig  ---
Author: tkoenig
Date: Tue Feb 20 18:57:34 2018
New Revision: 257856

URL: https://gcc.gnu.org/viewcvs?rev=257856=gcc=rev
Log:
2018-02-20  Thomas Koenig  

PR fortran/48890
PR fortran/83823
* primary.c (gfc_convert_to_structure_constructor):
For a constant string constructor, make sure the length
is correct.

2018-02-20  Thomas Koenig  

PR fortran/48890
PR fortran/83823
* gfortran.dg/structure_constructor_14.f90: New test.


Added:
trunk/gcc/testsuite/gfortran.dg/structure_constructor_14.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/primary.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/83823] [8 Regression] Character length issues with PACK()

2018-02-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83823

Thomas Koenig  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |tkoenig at gcc dot 
gnu.org

[Bug fortran/83823] [8 Regression] Character length issues with PACK()

2018-02-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83823

--- Comment #4 from Thomas Koenig  ---
The problem seems to be the simplifcation which gets the
string length wrong.

[Bug fortran/83823] [8 Regression] Character length issues with PACK()

2018-02-18 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83823

--- Comment #3 from Thomas Koenig  ---
r254157 is the culprit (r254156 is OK).

Just how this patch has caused this regression isn't quite
clear at first glance... I'll look.

[Bug fortran/83823] [8 Regression] Character length issues with PACK()

2018-02-01 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83823

--- Comment #2 from Thomas Koenig  ---
-fsanitize=address gives:


==21482==ERROR: AddressSanitizer: global-buffer-overflow on address
0x00402624 at pc 0x7f6d755ede76 bp 0x7ffed65778c0 sp 0x7ffed6577070
READ of size 5 at 0x00402624 thread T0
#0 0x7f6d755ede75 in __interceptor_memmove
../../../../trunk/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:720
#1 0x40134d in gfcbug145 /tmp/foo.f90:14
#2 0x402323 in main /tmp/foo.f90:17
#3 0x7f6d745f6f49 in __libc_start_main (/lib64/libc.so.6+0x20f49)
#4 0x400c89 in _start (/tmp/a.out+0x400c89)

0x00402624 is located 60 bytes to the left of global variable '*.LC6'
defined in 'foo.f90' (0x402660) of size 5
0x00402624 is located 0 bytes to the right of global variable '*.LC5'
defined in 'foo.f90' (0x402620) of size 4
SUMMARY: AddressSanitizer: global-buffer-overflow
../../../../trunk/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:720
in __interceptor_memmove
Shadow bytes around the buggy address:
  0x80078470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x80078480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x80078490: 00 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9 f9
  0x800784a0: f9 f9 f9 f9 00 06 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x800784b0: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 05 f9 f9 f9
=>0x800784c0: f9 f9 f9 f9[04]f9 f9 f9 f9 f9 f9 f9 05 f9 f9 f9
  0x800784d0: f9 f9 f9 f9 00 00 00 00 f9 f9 f9 f9 00 00 00 00
  0x800784e0: f9 f9 f9 f9 00 00 00 04 f9 f9 f9 f9 00 00 00 00
  0x800784f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x80078500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x80078510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:   00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:   fa
  Freed heap region:   fd
  Stack left redzone:  f1
  Stack mid redzone:   f2
  Stack right redzone: f3
  Stack after return:  f5
  Stack use after scope:   f8
  Global redzone:  f9
  Global init order:   f6
  Poisoned by user:f7
  Container overflow:  fc
  Array cookie:ac
  Intra object redzone:bb
  ASan internal:   fe
  Left alloca redzone: ca
  Right alloca redzone:cb

This is the   print *,  pack (obstyp% name, mask) line.

[Bug fortran/83823] [8 Regression] Character length issues with PACK()

2018-01-24 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83823

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-01-24
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
The change occurred between revisions r253982 (2017-10-22, OK) and r254227
(2017-10-30, wrong code).

[Bug fortran/83823] [8 Regression] Character length issues with PACK()

2018-01-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83823

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P4

[Bug fortran/83823] [8 Regression] Character length issues with PACK()

2018-01-13 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83823

Thomas Koenig  changed:

   What|Removed |Added

 CC||tkoenig at gcc dot gnu.org
   Target Milestone|--- |8.0