public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60350] New: Incorrect -Wmaybe-uninitialized warning with incorrect location information
@ 2014-02-26 22:22 chengniansun at gmail dot com
  2014-02-26 22:37 ` [Bug c/60350] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: chengniansun at gmail dot com @ 2014-02-26 22:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60350
           Summary: Incorrect -Wmaybe-uninitialized warning with incorrect
                    location information
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chengniansun at gmail dot com

Two questions regarding the following case
1) the variables "pf" and "pv" are uninitialized, but not maybe-uninitialized.
I am not sure whether this is the design choice of gcc. 

2) The column numbers of the two warnings point to the same location ":", which
is not right. 


$: cat s.c 
void a(int i) {
  int (*pf)[2];
  int (*pv)[i + 1];
  (i ? pf : pv);
}
$: gcc-trunk -Wuninitialized -c s.c 
s.c: In function ‘a’:
s.c:4:11: warning: ‘pf’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   (i ? pf : pv);
           ^
s.c:4:11: warning: ‘pv’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
$: gcc-trunk --version
gcc-trunk (GCC) 4.9.0 20140226 (experimental)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>From gcc-bugs-return-444911-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Feb 26 22:25:08 2014
Return-Path: <gcc-bugs-return-444911-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29724 invoked by alias); 26 Feb 2014 22:25:08 -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 29669 invoked by uid 55); 26 Feb 2014 22:25:04 -0000
From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/60341] ICE compiling Nonmem 6.2.0
Date: Wed, 26 Feb 2014 22:25:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60341-4-4mVuUPhuwX@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60341-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60341-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: 2014-02/txt/msg02668.txt.bz2
Content-length: 536

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`341

--- Comment #7 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Wed, Feb 26, 2014 at 08:38:57PM +0000, mikael at gcc dot gnu.org wrote:
>
> Looks like an unguarded union access.
> This is a regression from the time there was now front-end optimization I
> guess?

Unfortunately, I've deleted versions of gfortran older than
4.6.x.  The code fails with all version above 4.6.x.  If
one adds -fno-frontend-optimize, then the code compiles.
So, yes, it is a regression.


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

* [Bug c/60350] Incorrect -Wmaybe-uninitialized warning with incorrect location information
  2014-02-26 22:22 [Bug c/60350] New: Incorrect -Wmaybe-uninitialized warning with incorrect location information chengniansun at gmail dot com
@ 2014-02-26 22:37 ` pinskia at gcc dot gnu.org
  2014-02-27  7:48 ` [Bug middle-end/60350] " mpolacek at gcc dot gnu.org
  2014-03-07 19:49 ` chengniansun at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-02-26 22:37 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
           Severity|normal                      |minor

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>2) The column numbers of the two warnings point to the same location ":", which is not right. 

This is most likely due to the casting which is added by the triany operator.


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

* [Bug middle-end/60350] Incorrect -Wmaybe-uninitialized warning with incorrect location information
  2014-02-26 22:22 [Bug c/60350] New: Incorrect -Wmaybe-uninitialized warning with incorrect location information chengniansun at gmail dot com
  2014-02-26 22:37 ` [Bug c/60350] " pinskia at gcc dot gnu.org
@ 2014-02-27  7:48 ` mpolacek at gcc dot gnu.org
  2014-03-07 19:49 ` chengniansun at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-02-27  7:48 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-02-27
                 CC|                            |mpolacek at gcc dot gnu.org
          Component|c                           |middle-end
     Ever confirmed|0                           |1

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I think the maybe-used-uninitialized warning is in place here, it depends on I
whether pf or pv is evaluated.  The column info looks bogus indeed.


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

* [Bug middle-end/60350] Incorrect -Wmaybe-uninitialized warning with incorrect location information
  2014-02-26 22:22 [Bug c/60350] New: Incorrect -Wmaybe-uninitialized warning with incorrect location information chengniansun at gmail dot com
  2014-02-26 22:37 ` [Bug c/60350] " pinskia at gcc dot gnu.org
  2014-02-27  7:48 ` [Bug middle-end/60350] " mpolacek at gcc dot gnu.org
@ 2014-03-07 19:49 ` chengniansun at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: chengniansun at gmail dot com @ 2014-03-07 19:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Chengnian Sun <chengniansun at gmail dot com> ---
(In reply to Marek Polacek from comment #2)
> I think the maybe-used-uninitialized warning is in place here, it depends on
> I whether pf or pv is evaluated.  The column info looks bogus indeed.

Thanks, Marek. I misunderstood the meaning of maybe-used-uninitialized warnings


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

end of thread, other threads:[~2014-03-07 19:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-26 22:22 [Bug c/60350] New: Incorrect -Wmaybe-uninitialized warning with incorrect location information chengniansun at gmail dot com
2014-02-26 22:37 ` [Bug c/60350] " pinskia at gcc dot gnu.org
2014-02-27  7:48 ` [Bug middle-end/60350] " mpolacek at gcc dot gnu.org
2014-03-07 19:49 ` chengniansun at gmail 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).