[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

2024-03-21 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49565

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #14 from anlauf at gcc dot gnu.org ---
OK, reopening.

The link in comment#5 currently has the status "Accepted" for dwarf-5:

https://dwarfstd.org/issues/121221.1.html

[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

2024-03-20 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49565

--- Comment #13 from Tom Tromey  ---
(In reply to anlauf from comment #12)
> After reading this ancient thread, I don't see anything left to do.  Closing.

GCC still emits

 <1>: Abbrev Number: 1 (DW_TAG_base_type)
   DW_AT_byte_size   : 4
   DW_AT_encoding: 7(unsigned)
   DW_AT_name: (indirect string, offset: 0x43):
character(kind=4)


i.e., DW_ATE_unsigned.
That still seems incorrect to me, so I think this should be reopened.

[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

2024-03-20 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49565

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #12 from anlauf at gcc dot gnu.org ---
After reading this ancient thread, I don't see anything left to do.  Closing.

[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

2019-04-03 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49565

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P4

--- Comment #11 from Dominique d'Humieres  ---
Frustrating!-(

[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

2019-02-10 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49565

Thomas Koenig  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #10 from Thomas Koenig  ---
Jason, can you maybe shed some light on this one?  Is gfortran doing
something wrong here, and if so, what could be done about it?

[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

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

--- Comment #9 from Dominique d'Humieres  ---
> I'd like some informed feedback on this before closing.

Me too, but what be done when I don't get any feedback over years?

[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

2019-02-10 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49565

Thomas Koenig  changed:

   What|Removed |Added

 CC||tkoenig at gcc dot gnu.org

--- Comment #8 from Thomas Koenig  ---
(In reply to Dominique d'Humieres from comment #7)
> > Any progress after two years and a half?
> 
> Any progress after two and a half more years? Shouldn't this PR be closed as
> FIXED (AFAIU this is not a fortran bug).

I'd like some informed feedback on this before closing.

[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

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

--- Comment #7 from Dominique d'Humieres  ---
> Any progress after two years and a half?

Any progress after two and a half more years? Shouldn't this PR be closed as
FIXED (AFAIU this is not a fortran bug).

[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

2015-10-20 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49565

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2015-10-20
 CC||jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #6 from Dominique d'Humieres  ---
> Now moved to http://www.dwarfstd.org/ShowIssue.php?issue=121221.1=closed
>
> Note: It is listed under "resolved issues".

Any progress after two years and a half?


[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

2013-03-15 Thread burnus at gcc dot gnu.org


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



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||burnus at gcc dot gnu.org



--- Comment #5 from Tobias Burnus burnus at gcc dot gnu.org 2013-03-15 
17:49:35 UTC ---

Now moved to http://www.dwarfstd.org/ShowIssue.php?issue=121221.1type=closed



Note: It is listed under resolved issues.


[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

2012-04-16 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49565

--- Comment #4 from Tobias Burnus burnus at gcc dot gnu.org 2012-04-16 
22:04:20 UTC ---
See also http://www.dwarfstd.org/ShowIssue.php?issue=120213.1


[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

2011-06-28 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49565

Tobias Burnus burnus at gcc dot gnu.org changed:

   What|Removed |Added

 CC||burnus at gcc dot gnu.org

--- Comment #1 from Tobias Burnus burnus at gcc dot gnu.org 2011-06-28 
16:07:33 UTC ---
From gcc/dwarf2out.c's base_type_die:

  if (TYPE_STRING_FLAG (type))
{
  if (TYPE_UNSIGNED (type))
encoding = DW_ATE_unsigned_char;

which should set it. However, there is also in gen_array_type_die the following
code:

  /* Emit DW_TAG_string_type for Fortran character types (with kind 1 only, as
 DW_TAG_string_type doesn't have DW_AT_type attribute).  */
  if (TYPE_STRING_FLAG (type)
   TREE_CODE (type) == ARRAY_TYPE
   is_fortran ()
   TYPE_MODE (TREE_TYPE (type)) == TYPE_MODE (char_type_node))

That has been added by Jakub's commit Rev. 139778:
http://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=cdba1d8f465a94f6f654bcc33a7663913df2181e;hp=98923a8420e5399f31613d93ebee61e63f2d36e1

Sumitted patch was http://gcc.gnu.org/ml/gcc-patches/2008-08/msg01680.html


[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

2011-06-28 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49565

--- Comment #2 from Tobias Burnus burnus at gcc dot gnu.org 2011-06-28 
16:45:35 UTC ---
There are two issues:

 a) The one mentioned by Jakub for the committal cited in comment 1
That seems to be a DWARF bug - and Tromey has now filled an issue; it
should
show up in a while at http://www.dwarfstd.org/Issues.php

The problem is that DW_TAG_string_type does not support DW_AT_type,
which makes it not suitable for character(kind=4) [as it already has to
handle character(kind=1)].

 b) Independent of that issue, GCC should emit DW_ATE_unsigned_char and not
DW_ATE_unsigned


The latter issue seems to come due to the following code in gen_array_type_die:

  if (TYPE_STRING_FLAG (type)
  /* Case handling kind=1 characters. */
{
  ...
  return;
}
  ...
  /* For Fortran multidimensional arrays use DW_ORD_col_major ordering.  */
  if (is_fortran ()
   TREE_CODE (type) == ARRAY_TYPE
   TREE_CODE (TREE_TYPE (type)) == ARRAY_TYPE
   !TYPE_STRING_FLAG (TREE_TYPE (type)))
add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_col_major);

This test is true as:
  (gdb) p type-type_common.string_flag
  $6 = 1
  (gdb) p type-typed.type-type_common.string_flag
  $7 = 0

I wonder whether the
  !TYPE_STRING_FLAG (TREE_TYPE (type)))
shouldn't be instead a
  !TYPE_STRING_FLAG (type))

Or alternatively, whether fortran/trans-type.c's
gfc_get_character_type_len_for_eltype should not only set
  TYPE_STRING_FLAG (type) = 1;
but also
  TYPE_STRING_FLAG (TREE_TYPE (type)) = 1;


[Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char

2011-06-28 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49565

--- Comment #3 from Tobias Burnus burnus at gcc dot gnu.org 2011-06-28 
16:55:16 UTC ---
(In reply to comment #2)
   /* For Fortran multidimensional arrays use DW_ORD_col_major ordering.  */
   if (is_fortran ()
TREE_CODE (type) == ARRAY_TYPE
TREE_CODE (TREE_TYPE (type)) == ARRAY_TYPE
!TYPE_STRING_FLAG (TREE_TYPE (type)))
 add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_col_major);

It's too warm to think poperly: TREE_CODE (type) is ARRAY_TYPE but
TREE_CODE(TREE_TYPE(type)) is INTEGER_TYPE - not an ARRAY_TYPE; hence the code
is never executed. Nevertheless, the issue is presumably related to type having
TYPE_STRING_FLAG set, but TREE_TYPE(type) having it not.