public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60279] New: Incorrect column number for -Wuninitialized in return statement
@ 2014-02-20  1:07 chengniansun at gmail dot com
  2014-02-20  6:12 ` [Bug tree-optimization/60279] " mpolacek at gcc dot gnu.org
  2021-08-08  4:26 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: chengniansun at gmail dot com @ 2014-02-20  1:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60279
           Summary: Incorrect column number for -Wuninitialized in return
                    statement
           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

I found the column number in the return statement of -Wuninitialized is not
correct. 


$: cat s.c 
int g(char *);
int f(void) {
  char *s;
  return          g(s);
}
$: gcc-trunk -Wuninitialized -c s.c
s.c: In function ‘f’:
s.c:4:3: warning: ‘s’ is used uninitialized in this function [-Wuninitialized]
   return          g(s);
   ^
$: gcc-trunk --version
gcc-trunk (GCC) 4.9.0 20140217 (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-444282-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 20 01:33:06 2014
Return-Path: <gcc-bugs-return-444282-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5968 invoked by alias); 20 Feb 2014 01:33:06 -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 5909 invoked by uid 55); 20 Feb 2014 01:33:01 -0000
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/58555] [4.9 Regression] Floating point exception in want_inline_self_recursive_call_p
Date: Thu, 20 Feb 2014 01:33:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: hubicka at ucw dot cz
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P1
X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58555-4-wk3lV1BRK6@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58555-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58555-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/msg02039.txt.bz2
Content-length: 447

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

--- Comment #24 from Jan Hubicka <hubicka at ucw dot cz> ---
> > So, shall we just apply #c15 here?
>
> Diff works fine for me for over five weeks now, so I say yes.

It is easier to just return at beggining instead of duplicating the check.
Have patch for it, just for some reason
I wanted to look deper into why we inline here.  I forgot the reason, but will
work it out again today.

Honza


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

* [Bug tree-optimization/60279] Incorrect column number for -Wuninitialized in return statement
  2014-02-20  1:07 [Bug c/60279] New: Incorrect column number for -Wuninitialized in return statement chengniansun at gmail dot com
@ 2014-02-20  6:12 ` mpolacek at gcc dot gnu.org
  2021-08-08  4:26 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-02-20  6:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed, though this warning isn't generated by the C FE.


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

* [Bug tree-optimization/60279] Incorrect column number for -Wuninitialized in return statement
  2014-02-20  1:07 [Bug c/60279] New: Incorrect column number for -Wuninitialized in return statement chengniansun at gmail dot com
  2014-02-20  6:12 ` [Bug tree-optimization/60279] " mpolacek at gcc dot gnu.org
@ 2021-08-08  4:26 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-08  4:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60279

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |5.0
             Status|NEW                         |RESOLVED
           Keywords|                            |diagnostic
         Resolution|---                         |FIXED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
trunk
<source>: In function 'f':
<source>:5:19: warning: 's' is used uninitialized [-Wuninitialized]
    5 |   return          g(s);
      |                   ^~~~


7:
<source>: In function 'f':
<source>:5:19: warning: 's' is used uninitialized in this function
[-Wuninitialized]
   return          g(s);
                   ^~~~


5:
<source>: In function 'f':
<source>:5:19: warning: 's' is used uninitialized in this function
[-Wuninitialized]
   return          g(s);
                   ^

So fixed in GCC 5.

For the C++ front-end:
8:
<source>: In function 'int f()':
<source>:5:20: warning: 's' is used uninitialized in this function
[-Wuninitialized]
   return          g(s);
                   ~^~~
7:
<source>: In function 'int f()':
<source>:5:22: warning: 's' is used uninitialized in this function
[-Wuninitialized]
   return          g(s);
                      ^

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

end of thread, other threads:[~2021-08-08  4:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20  1:07 [Bug c/60279] New: Incorrect column number for -Wuninitialized in return statement chengniansun at gmail dot com
2014-02-20  6:12 ` [Bug tree-optimization/60279] " mpolacek at gcc dot gnu.org
2021-08-08  4:26 ` pinskia 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).