public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/46974] ICE with TRANSFER using a C_PTR entity
Date: Sat, 18 Dec 2010 10:07:00 -0000 [thread overview]
Message-ID: <bug-46974-4-FrzeEMIapN@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46974-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46974
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-18 10:07:33 UTC ---
(In reply to comment #3)
> + if ((mold->expr_type == EXPR_VARIABLE || mold->expr_type == EXPR_STRUCTURE)
> + && mold->ts.type == BT_DERIVED && mold->ts.u.derived
> + && (strcmp(mold->ts.u.derived->name, "c_ptr") == 0
> + || strcmp(mold->ts.u.derived->name, "c_funptr") == 0))
> + return NULL;
> +
Won't this cause problems with user-defined types with the same name?
Additionally, I would rather bring C_PTR/C_FUNPTR closer a normal derived type
(which is only in the last step treated specially) than to introduce hacks like
that.
The reason for the crash is that in gfc_interpret_derived the pointer component
of "c_ptr" ("__c_ptr_c_address") has no backend declaration (cmp->backend_decl
== NULL) - and thus "ptr = TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET
(cmp->backend_decl))" crashes. Maybe it is sufficient to set it via
gfc_typenode_for_spec in that function.
I think the advantage of fixing this part of the code is that one can simplify
the code at compile time - which is usually preferred to run-time evaluation.
next prev parent reply other threads:[~2010-12-18 10:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 21:39 [Bug fortran/46974] New: " kargl at gcc dot gnu.org
2010-12-17 23:15 ` [Bug fortran/46974] " kargl at gcc dot gnu.org
2010-12-18 0:01 ` sgk at troutmask dot apl.washington.edu
2010-12-18 6:45 ` sgk at troutmask dot apl.washington.edu
2010-12-18 10:07 ` burnus at gcc dot gnu.org [this message]
2010-12-18 15:38 ` burnus at gcc dot gnu.org
2010-12-18 16:21 ` burnus at gcc dot gnu.org
2010-12-18 17:11 ` sgk at troutmask dot apl.washington.edu
2010-12-18 20:19 ` burnus at gcc dot gnu.org
2010-12-18 20:26 ` burnus at gcc dot gnu.org
2010-12-19 11:25 ` burnus at gcc dot gnu.org
2010-12-20 21:44 ` burnus at gcc dot gnu.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-46974-4-FrzeEMIapN@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).