[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2019-01-26 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

Dominique d'Humieres  changed:

   What|Removed |Added

 CC||nikolay.piskun at roguewave 
dot co
   ||m

--- Comment #14 from Dominique d'Humieres  ---
*** Bug 77865 has been marked as a duplicate of this bug. ***

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-11-04 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #13 from Jakub Jelinek  ---
Regression should be fixed.

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

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

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|NEW |WAITING
 Blocks||24546

--- Comment #12 from Dominique d'Humieres  ---
What remains to be fixed after revision r239473?

Duplicate of/ related to pr77865?


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24546
[Bug 24546] [meta-bug] gfortran debugging problems

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

--- Comment #11 from Richard Biener  ---
GCC 6.2 is being released, adjusting target milestone.

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

--- Comment #10 from Richard Biener  ---
GCC 6.2 is being released, adjusting target milestone.

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

--- Comment #9 from Richard Biener  ---
GCC 6.2 is being released, adjusting target milestone.

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|6.2 |6.3

--- Comment #8 from Richard Biener  ---
GCC 6.2 is being released, adjusting target milestone.

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-08-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Mon Aug 15 10:05:59 2016
New Revision: 239473

URL: https://gcc.gnu.org/viewcvs?rev=239473=gcc=rev
Log:
PR debug/71906
* dwarf2out.c (string_types): New variable.
(gen_array_type_die): Change early_dwarf handling of
DW_AT_string_length, create DW_OP_call4 referencing the
length var temporarily.  Handle parameters that are pointers
to string length.
(adjust_string_types): New function.
(gen_subprogram_die): Temporarily set string_types to local var,
call adjust_string_types if needed.
(non_dwarf_expression, copy_deref_exprloc, optimize_string_length):
New functions.
(resolve_addr): Adjust DW_AT_string_length if it is DW_OP_call4.

* trans-decl.c (gfc_get_symbol_decl): Call gfc_finish_var_decl
for decl's character length before gfc_finish_var_decl on the
decl itself.

Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/dwarf2out.c
branches/gcc-6-branch/gcc/fortran/ChangeLog
branches/gcc-6-branch/gcc/fortran/trans-decl.c

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-08-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Mon Aug 15 09:50:33 2016
New Revision: 239469

URL: https://gcc.gnu.org/viewcvs?rev=239469=gcc=rev
Log:
PR debug/71906
* dwarf2out.c (string_types): New variable.
(gen_array_type_die): Change early_dwarf handling of
DW_AT_string_length, create DW_OP_call4 referencing the
length var temporarily.  Handle parameters that are pointers
to string length.
(adjust_string_types): New function.
(gen_subprogram_die): Temporarily set string_types to local var,
call adjust_string_types if needed.
(non_dwarf_expression, copy_deref_exprloc, optimize_string_length):
New functions.
(resolve_addr): Adjust DW_AT_string_length if it is DW_OP_call4.

* trans-decl.c (gfc_get_symbol_decl): Call gfc_finish_var_decl
for decl's character length before gfc_finish_var_decl on the
decl itself.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-decl.c

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-08-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-07-19 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

--- Comment #5 from Dominique d'Humieres  ---
Related to/ duplicate of pr59438?

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-07-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

--- Comment #4 from Jakub Jelinek  ---
Created attachment 38923
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38923=edit
gcc7-pr71906-wip.patch

Untested WIP patch, that should fix the vara, varb and vare cases at -O0, for
optimized builds the DW_OP_call4 isn't the best thing to do, if the _var*/.var*
argument/variable doesn't live in memory.  I'll try tomorrow adjusting it
during late debug when we have location info for the variable/parameter.

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-07-18 Thread jan.kratochvil at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

--- Comment #3 from Jan Kratochvil  ---
Could you attach here the ICC .s file if you have it handy?  Thanks.

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-07-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

Jakub Jelinek  changed:

   What|Removed |Added

 CC||aldyh at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Better testcase that shows more cases:

program pr71906
  character(len=8) :: vard
  character(len=:), allocatable :: vare
  type t
character(len=:), allocatable :: f
  end type
  type(t) :: varf
  allocate(character(len=10) :: vare)
  allocate(character(len=9) :: varf%f)
  vare = 'foo'
  call foo (vard, vare, varf)
contains
  subroutine foo (vara, varb, varc)
character(len=*) :: vara
character(len=:), allocatable :: varb
type(t) :: varc
vara = 'bar'
varb = 'baz'
varc%f = 'str'
  end subroutine
end program pr71906

The problem is that DW_AT_string_length attribute allows just exprloc or
loclistptr classes.  Even GCC 5.x doesn't handle here the varb case, and
varc/varf case.  For varb the string length is *.varb (.varb being an
artificial argument), for varc/varf the struct has fields f and _f_length.

With the early debug changes, nothing works anymore.

While DW_AT_upper_bound etc. allows a DIE ref, so even with early debug we can
put something (the DIE ref) into the attribute, for DW_AT_string_length we only
have a decl (VAR_DECL/PARM_DECL/FIELD_DECL) or INDIRECT_REF of it, the DIE for
it might not be created yet and even if it is, obviously it has no location
information yet (that only appears when we actually compile corresponding
function).

I've tried to use DW_OP_call4 in DW_AT_string_length, but I bet that will only
work if the artificial length vars have a DWARF expression in their
DW_AT_location (or DWARF expression in their DW_AT_location location list for
the current location), having something that ends up with DW_OP_stack_value
etc. is not valid DWARF I bet.

Another thing is the type of the f field.
The string length in that case is present in the same aggregate, but is not
necessarily adjacent to the f field (e.g. if one puts integer :: i field after
f, then the order is f, i, _f_length).
Not sure what to emit in those DW_AT_string_length for it at all right now.

Looking for what ICC emits, it doesn't emit anything useful for f, but for
varb and vare it emits
DW_OP_push_object_address; DW_OP_constu: 8; DW_OP_plus
as DW_AT_string_length.  It is unclear what they expect to be
DW_OP_push_object_address here, and what/if anything GDB expands it.  Is it the
address of the object that has the string type, or the address of the object
that has DW_TAG_pointer_type to DW_TAG_string_type, something else?

[Bug debug/71906] [6/7 Regression] Fortran allocatable strings debug info type size regression

2016-07-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71906

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-07-18
 CC||jakub at gcc dot gnu.org
   Target Milestone|--- |6.2
Summary|Fortran allocatable strings |[6/7 Regression] Fortran
   |debug info type size|allocatable strings debug
   |regression  |info type size regression
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Broken by r224161.