public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57991] New: Enhance "Same actual argument associated" warning (-Waliasing)
@ 2013-07-26 10:02 burnus at gcc dot gnu.org
  2013-07-27 14:17 ` [Bug fortran/57991] " burnus at gcc dot gnu.org
  2013-07-27 14:18 ` burnus at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-07-26 10:02 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57991
           Summary: Enhance "Same actual argument associated" warning
                    (-Waliasing)
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org

gfortran currently warns with -Waliasing for the case:

   Warning: Same actual argument associated with INTENT(IN) argument 'a'
            and INTENT(OUT) argument 'b' at (1)

However, I believe gfortran should also warn if both are INTENT(OUT) -
currently, it doesn't:

      Program q1
        Call test(x, x)
      Contains
        Subroutine test(a,b)
          Integer, intent(out) :: a,b
          a = a*10
          Print *,a,b
        End Subroutine
      End Program

Side remark: The test case is also invalid for other reasons; it's a modified
version of
https://groups.google.com/forum/#!topic/comp.lang.fortran/1ZVmajE1Mjs


See "check_some_aliasing":
          if ((f1_intent == INTENT_IN && f2_intent == INTENT_OUT)
              || (f1_intent == INTENT_OUT && f2_intent == INTENT_IN))



From F2008's "12.5.2.13 Restrictions on entities associated with dummy
arguments"

"(3) Action that a\vects the value of the entity or any subobject of it shall be
taken only through the dummy argument unless
(a) the dummy argument has the POINTER attribute or
(b) the dummy argument has the TARGET attribute, the dummy argument does not
have INTENT(IN), the dummy argument is a scalar object or an assumed-shape
array without the CONTIGUOUS attribute, and the actual argument is a target
other than an array section with a vector subscript."
>From gcc-bugs-return-426755-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jul 26 10:24:07 2013
Return-Path: <gcc-bugs-return-426755-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23538 invoked by alias); 26 Jul 2013 10:24:07 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 23425 invoked by uid 48); 26 Jul 2013 10:24:02 -0000
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57101] [4.8/4.9 Regression] -fcompare-debug failure with <type error>
Date: Fri, 26 Jul 2013 10:24:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: paolo.carlini at oracle dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.2
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57101-4-dWG2efUDNh@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57101-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57101-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-07/txt/msg01262.txt.bz2
Content-length: 239

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW101

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
This is fixed in mainline. I'm adding the testcase and keeping the bug open
with only the [4.8 Regression] marker.


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

* [Bug fortran/57991] Enhance "Same actual argument associated" warning (-Waliasing)
  2013-07-26 10:02 [Bug fortran/57991] New: Enhance "Same actual argument associated" warning (-Waliasing) burnus at gcc dot gnu.org
@ 2013-07-27 14:17 ` burnus at gcc dot gnu.org
  2013-07-27 14:18 ` burnus at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-07-27 14:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Author: burnus
Date: Sat Jul 27 14:17:01 2013
New Revision: 201286

URL: http://gcc.gnu.org/viewcvs?rev=201286&root=gcc&view=rev
Log:
2013-07-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/57991
        * interface.c (check_some_aliasing): Also warn for intent
        * OUT/OUT.

2013-07-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/57991
        * gfortran.dg/warn_alias.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/warn_alias.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/interface.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/57991] Enhance "Same actual argument associated" warning (-Waliasing)
  2013-07-26 10:02 [Bug fortran/57991] New: Enhance "Same actual argument associated" warning (-Waliasing) burnus at gcc dot gnu.org
  2013-07-27 14:17 ` [Bug fortran/57991] " burnus at gcc dot gnu.org
@ 2013-07-27 14:18 ` burnus at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-07-27 14:18 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
FIXED on the trunk (4.9).


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

end of thread, other threads:[~2013-07-27 14:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26 10:02 [Bug fortran/57991] New: Enhance "Same actual argument associated" warning (-Waliasing) burnus at gcc dot gnu.org
2013-07-27 14:17 ` [Bug fortran/57991] " burnus at gcc dot gnu.org
2013-07-27 14:18 ` burnus at gcc dot gnu.org

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