public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/44978] derived types are resolved more than once
Date: Sun, 11 Aug 2013 08:54:00 -0000	[thread overview]
Message-ID: <bug-44978-4-I3R1VR56eO@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-44978-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #13 from janus at gcc dot gnu.org ---
(In reply to Mikael Morin from comment #12)
> > IMHO it is probably not worth the hassle. I wouldn't like to do this without
> > having a concrete reason for it (and with a clean testsuite I don't see any).
> > 
> The reason is: 
> the sym->resolved flag is an internal detail that should not be externally
> visible; it shouldn't change the return value.

well, I guess one could argue that the return value of 'resolve_fl_derived' is
an internal detail in the same sense as sym->resolved (both are not directly
'user-visible').


> > Well, the advantage of my original patch is obviously that it not only
> > avoids the double errors, but it also prevents us from doing double the work
> > in resolving the symbols, so it might even give a performance improvement
> > for large codes, in particular with heavy OOP (not sure if it's anywhere
> > close to being significant, though).
> 
> All right, the only one solution left that I see is the one making the
> functions void. See the attached patch (comments welcome).
> I ran the testsuite partially on it and it was clean, but I don't have the
> time to finish that right now. It looked as slow as usual by the way. ;-)

Your patch does not compile cleanly, but after a small fix to make it compile,
the testsuite runs through successfully. (Btw I would not really expect a
visible performance effect in the testsuite, because the share of OOP code in
there is probably still rather low, even if it's growing slowly.)

However, I don't quite see the point of doing this: Doesn't a void return value
have basically the same effect as returning true? (i.e. to "keep going",
whereas returning false means to "back out", since there was a problem)

Therefore I don't really see the improvement here. To the contrary: I would
rather say we should propagate the return values as far as possible (one case
where it is currently not propagated is resolve_symbol). This alone might even
get rid of the double errors (if one pulls it through fully), but again it does
not really help with double resolution in the non-error case, so I'd say we
still need to rely on sym->resolved.

But in addition (as a follow-up?) it might be worth to use more bool return
values instead of void in the resolve_* routines (e.g. resolve_symbol). IIRC
there might even be a another PR where this helps (will see if I can still find
it ...)


  parent reply	other threads:[~2013-08-11  8:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-44978-4@http.gcc.gnu.org/bugzilla/>
2013-04-13 11:15 ` [Bug fortran/44978] extended " janus at gcc dot gnu.org
2013-06-15 11:12 ` dominiq at lps dot ens.fr
2013-08-08 20:00 ` [Bug fortran/44978] " janus at gcc dot gnu.org
2013-08-08 21:24 ` janus at gcc dot gnu.org
2013-08-09  6:00 ` janus at gcc dot gnu.org
2013-08-09 13:37 ` janus at gcc dot gnu.org
2013-08-09 13:59 ` janus at gcc dot gnu.org
2013-08-09 15:03 ` mikael at gcc dot gnu.org
2013-08-09 19:23 ` janus at gcc dot gnu.org
2013-08-09 19:55 ` mikael at gcc dot gnu.org
2013-08-10  7:55 ` janus at gcc dot gnu.org
2013-08-11  8:54 ` janus at gcc dot gnu.org [this message]
2013-08-11 11:34 ` mikael at gcc dot gnu.org
2013-08-11 17:22 ` janus at gcc dot gnu.org
2013-08-11 19:12 ` mikael at gcc dot gnu.org
2013-08-13  9:38 ` dominiq at lps dot ens.fr
2013-08-13  9:40 ` dominiq at lps dot ens.fr
2013-08-13  9:54 ` dominiq at lps dot ens.fr
2013-08-13 14:14 ` dominiq at lps dot ens.fr
2015-01-15 18:44 ` janus 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-44978-4-I3R1VR56eO@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).