From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 934 invoked by alias); 28 Jun 2011 16:45:55 -0000 Received: (qmail 924 invoked by uid 22791); 28 Jun 2011 16:45:54 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Jun 2011 16:45:40 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49565] character(kind=4) is emitted as DW_ATE_unsigned, not DW_ATE_unsigned_char X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 28 Jun 2011 16:45:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg02752.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49565 --- Comment #2 from Tobias Burnus 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;