public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57791] New: Waste work in gfc_check_pointer_assign()
@ 2013-07-02 20:32 pchang9 at cs dot wisc.edu
  2013-07-03  6:56 ` [Bug fortran/57791] " burnus at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: pchang9 at cs dot wisc.edu @ 2013-07-02 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57791
           Summary: Waste work in gfc_check_pointer_assign()
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pchang9 at cs dot wisc.edu
                CC: nistor1 at illinois dot edu

Created attachment 30430
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30430&action=edit
Suggested patch

The problem appears in revision 200588 in version 4.9. I have attached a
one-line patch that fixes it.

In method "gfc_check_pointer_assign()" in expr.c, the loop on line 3763 should
break immediately after "warn" is set to "true". All the iterations after
"warn" set to "true" do not perform any useful work, at best they just set
"warn" again to "true".


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/57791] Waste work in gfc_check_pointer_assign()
  2013-07-02 20:32 [Bug fortran/57791] New: Waste work in gfc_check_pointer_assign() pchang9 at cs dot wisc.edu
@ 2013-07-03  6:56 ` burnus at gcc dot gnu.org
  2013-07-23 21:43 ` [Bug fortran/57791] Wasted " pchang9 at cs dot wisc.edu
  2013-07-29 19:09 ` law at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-07-03  6:56 UTC (permalink / raw)
  To: gcc-bugs

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

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> ---
(In reply to Po-Chun Chang from comment #0)
> Suggested patch
> 
> In method "gfc_check_pointer_assign()" in expr.c, the loop on line 3763
> should break immediately after "warn" is set to "true". All the iterations
> after "warn" set to "true" do not perform any useful work, at best they just
> set "warn" again to "true".

I concur.

(Note that the nesting depth is rather shallow [one or two, rarely three and
essentially never four or more] and only pointer comparisons are done, which is
computationally cheap. Thus, the current version doesn't waste many cycles.)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/57791] Wasted work in gfc_check_pointer_assign()
  2013-07-02 20:32 [Bug fortran/57791] New: Waste work in gfc_check_pointer_assign() pchang9 at cs dot wisc.edu
  2013-07-03  6:56 ` [Bug fortran/57791] " burnus at gcc dot gnu.org
@ 2013-07-23 21:43 ` pchang9 at cs dot wisc.edu
  2013-07-29 19:09 ` law at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pchang9 at cs dot wisc.edu @ 2013-07-23 21:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Po-Chun Chang <pchang9 at cs dot wisc.edu> ---
Patch sent to gcc-patches@ and fortran@

http://gcc.gnu.org/ml/gcc-patches/2013-07/msg01056.html
http://gcc.gnu.org/ml/fortran/2013-07/msg00070.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/57791] Wasted work in gfc_check_pointer_assign()
  2013-07-02 20:32 [Bug fortran/57791] New: Waste work in gfc_check_pointer_assign() pchang9 at cs dot wisc.edu
  2013-07-03  6:56 ` [Bug fortran/57791] " burnus at gcc dot gnu.org
  2013-07-23 21:43 ` [Bug fortran/57791] Wasted " pchang9 at cs dot wisc.edu
@ 2013-07-29 19:09 ` law at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: law at redhat dot com @ 2013-07-29 19:09 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |law at redhat dot com
         Resolution|---                         |FIXED

--- Comment #3 from Jeffrey A. Law <law at redhat dot com> ---
Patch installed on trunk.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-07-29 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-02 20:32 [Bug fortran/57791] New: Waste work in gfc_check_pointer_assign() pchang9 at cs dot wisc.edu
2013-07-03  6:56 ` [Bug fortran/57791] " burnus at gcc dot gnu.org
2013-07-23 21:43 ` [Bug fortran/57791] Wasted " pchang9 at cs dot wisc.edu
2013-07-29 19:09 ` law at redhat dot com

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).