public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/100132] Optimization breaks pointer association Date: Sun, 18 Sep 2022 19:11:59 +0000 [thread overview] Message-ID: <bug-100132-4-phOp41gZG0@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-100132-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100132 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org --- Comment #3 from anlauf at gcc dot gnu.org --- (In reply to José Rui Faustino de Sousa from comment #1) > Patch posted > > https://gcc.gnu.org/pipermail/fortran/2021-April/055946.html The patch is technically fine and regtests ok, but was unfortunately never reviewed. The basic fix can be slightly shortened to: diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc index 0ea7c74a6f1..c062a5b29d7 100644 --- a/gcc/fortran/trans-types.cc +++ b/gcc/fortran/trans-types.cc @@ -3054,12 +3054,23 @@ create_fn_spec (gfc_symbol *sym, tree fntype) for (f = gfc_sym_get_dummy_args (sym); f; f = f->next) if (spec_len < sizeof (spec)) { - if (!f->sym || f->sym->attr.pointer || f->sym->attr.target + bool is_class = false; + bool is_pointer = false; + + if (f->sym) + { + is_class = f->sym->ts.type == BT_CLASS && CLASS_DATA (f->sym) + && f->sym->attr.class_ok; + is_pointer = is_class ? CLASS_DATA (f->sym)->attr.class_pointer + : f->sym->attr.pointer; + } + + if (f->sym == NULL || is_pointer || f->sym->attr.target || f->sym->attr.external || f->sym->attr.cray_pointer || (f->sym->ts.type == BT_DERIVED && (f->sym->ts.u.derived->attr.proc_pointer_comp || f->sym->ts.u.derived->attr.pointer_comp)) - || (f->sym->ts.type == BT_CLASS + || (is_class && (CLASS_DATA (f->sym)->ts.u.derived->attr.proc_pointer_comp || CLASS_DATA (f->sym)->ts.u.derived->attr.pointer_comp)) || (f->sym->ts.type == BT_INTEGER && f->sym->ts.is_c_interop)) I can take care of it for you.
next prev parent reply other threads:[~2022-09-18 19:11 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-17 23:38 [Bug fortran/100132] New: " jrfsousa at gmail dot com 2021-04-18 0:20 ` [Bug fortran/100132] " jrfsousa at gmail dot com 2021-04-18 9:43 ` dominiq at lps dot ens.fr 2022-09-18 19:11 ` anlauf at gcc dot gnu.org [this message] 2022-09-19 20:21 ` anlauf at gcc dot gnu.org 2022-09-20 18:31 ` cvs-commit at gcc dot gnu.org 2022-10-01 18:17 ` cvs-commit at gcc dot gnu.org 2022-10-01 18:40 ` cvs-commit at gcc dot gnu.org 2022-10-01 18:55 ` cvs-commit at gcc dot gnu.org 2022-10-01 18:56 ` anlauf at gcc dot gnu.org 2022-10-17 20:36 ` anlauf 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-100132-4-phOp41gZG0@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: linkBe 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).