public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/44307]  New: warning: may be used uninitialized in this function often building gcc
@ 2010-05-28 10:43 jay dot krell at cornell dot edu
  2010-05-28 10:45 ` [Bug c/44307] " rguenth at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: jay dot krell at cornell dot edu @ 2010-05-28 10:43 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 5940 bytes --]

warning: may be used uninitialized in this function


Including but not necessarily limited to:


ebitmap.c: In function ‘ebitmap_ior_into’:
ebitmap.c:554: warning: ‘i’ may be used uninitialized in this function
ebitmap.c: In function ‘ebitmap_ior’:
ebitmap.c:678: warning: ‘i’ may be used uninitialized in this function
ebitmap.c: In function ‘ebitmap_and_compl’:
ebitmap.c:876: warning: ‘i’ may be used uninitialized in this function
ebitmap.c: In function ‘ebitmap_and_into’:
ebitmap.c:425: warning: ‘i’ may be used uninitialized in this function
ebitmap.c: In function ‘ebitmap_and’:
ebitmap.c:479: warning: ‘i’ may be used uninitialized in this function
ebitmap.c: In function ‘ebitmap_and_compl_into’:
ebitmap.c:796: warning: ‘i’ may be used uninitialized in this function
ira.c:1623: warning: ‘a’ may be used uninitialized in this function
ira.c:1588: warning: ‘a’ may be used uninitialized in this function
ira.c:1656: warning: ‘a’ may be used uninitialized in this function
ira-build.c: In function ‘ira_flattening’:
ira-build.c:2468: warning: ‘a’ may be used uninitialized in this function
ira-build.c:720: warning: ‘a’ may be used uninitialized in this function
ira-build.c:2469: warning: ‘cp’ may be used uninitialized in this function
ira-build.c:347: warning: ‘a’ may be used uninitialized in this function
ira-build.c: In function ‘print_copies’:
ira-build.c:1233: warning: ‘cp’ may be used uninitialized in this function
ira-build.c: In function ‘ira_destroy’:
ira-build.c:1294: warning: ‘cp’ may be used uninitialized in this function
ira-build.c:1008: warning: ‘a’ may be used uninitialized in this function
ira-build.c: In function ‘remove_unnecessary_regions’:
ira-build.c:2007: warning: ‘a’ may be used uninitialized in this function
ira-build.c: In function ‘ira_build’:
ira-build.c:2119: warning: ‘a’ may be used uninitialized in this function
ira-build.c:2358: warning: ‘a’ may be used uninitialized in this function
ira-build.c:2170: warning: ‘a’ may be used uninitialized in this function
ira-build.c:2252: warning: ‘a’ may be used uninitialized in this function
ira-build.c:2797: warning: ‘a’ may be used uninitialized in this function
ira-build.c:2823: warning: ‘a’ may be used uninitialized in this function
ira-costs.c: In function ‘ira_tune_allocno_costs_and_cover_classes’:
ira-costs.c:1728: warning: ‘a’ may be used uninitialized in this function
ira-costs.c: In function ‘find_costs_and_classes’:
ira-costs.c:1181: warning: ‘a’ may be used uninitialized in this function
ira-costs.c:1062: warning: ‘a’ may be used uninitialized in this function
ira-costs.c: In function ‘ira_costs’:
ira-costs.c:1537: warning: ‘a’ may be used uninitialized in this function
ira-conflicts.c: In function ‘build_allocno_conflicts’:
ira-conflicts.c:566: warning: ‘i’ may be used uninitialized in this function
ira-conflicts.c: In function ‘print_conflicts’:
ira-conflicts.c:698: warning: ‘conflict_a’ may be used uninitialized in this
function
ira-conflicts.c:692: warning: ‘a’ may be used uninitialized in this function
ira-conflicts.c: In function ‘ira_build_conflicts’:
ira-conflicts.c:73: warning: ‘allocno’ may be used uninitialized in this
function
ira-conflicts.c:533: warning: ‘cp’ may be used uninitialized in this function
ira-conflicts.c:763: warning: ‘a’ may be used uninitialized in this function
ira-color.c: In function ‘update_conflict_hard_regno_costs’:
ira-color.c:325: warning: ‘divisor’ may be used uninitialized in this function
ira-color.c:330: warning: ‘allocno’ may be used uninitialized in this function
ira-color.c: In function ‘ira_color’:
ira-color.c:3334: warning: ‘a’ may be used uninitialized in this function
ira-color.c:2112: warning: ‘a’ may be used uninitialized in this function
ira-color.c:3265: warning: ‘a’ may be used uninitialized in this function
ira-color.c: In function ‘push_allocno_to_stack’:
ira-color.c:865: warning: ‘conflict_allocno’ may be used uninitialized in this
function
ira-color.c: In function ‘assign_hard_reg’:
ira-color.c:449: warning: ‘conflict_allocno’ may be used uninitialized in this
function
ira-color.c: In function ‘ira_reassign_conflict_allocnos’:
ira-color.c:2281: warning: ‘conflict_a’ may be used uninitialized in this
function
ira-color.c:2281: warning: ‘a’ may be used uninitialized in this function
ira-color.c: In function ‘ira_reassign_pseudos’:
ira-color.c:2867: warning: ‘conflict_a’ may be used uninitialized in this
function
ira-color.c: In function ‘coalesce_allocnos’:
ira-color.c:1554: warning: ‘conflict_allocno’ may be used uninitialized in this
function
ira-color.c: In function ‘ira_sort_regnos_for_alter_reg’:
ira-color.c:2618: warning: ‘a’ may be used uninitialized in this function
ira-color.c: In function ‘color_pass’:
ira-color.c:1397: warning: ‘conflict_allocno’ may be used uninitialized in this
function



In my copy I just put " = { 0 }" after each of these.
  (Ignoring which particular ones needed it and just
  going by variable names alone, ignoring scope.)


I'm using -disable-bootstrap.
But I suspect it doesn't matter in this case (unlike with -Wcast-qual).


Personally, I sprinkle " = { 0 }" liberally my own code.
My code tends to be I/O bound, and many of these will be trivially optimized
away anyway, but granted, not all. I never want to debug an uninitialized local
again, and I don't trust compilers to tell me when they might occur.


-- 
           Summary: warning: may be used uninitialized in this function
                    often building gcc
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jay dot krell at cornell dot edu


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


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

* [Bug c/44307] warning: may be used uninitialized in this function often building gcc
  2010-05-28 10:43 [Bug c/44307] New: warning: may be used uninitialized in this function often building gcc jay dot krell at cornell dot edu
@ 2010-05-28 10:45 ` rguenth at gcc dot gnu dot org
  2010-05-28 10:48 ` jay dot krell at cornell dot edu
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-28 10:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2010-05-28 10:45 -------
What is your host compiler?


-- 


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


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

* [Bug c/44307] warning: may be used uninitialized in this function often building gcc
  2010-05-28 10:43 [Bug c/44307] New: warning: may be used uninitialized in this function often building gcc jay dot krell at cornell dot edu
  2010-05-28 10:45 ` [Bug c/44307] " rguenth at gcc dot gnu dot org
@ 2010-05-28 10:48 ` jay dot krell at cornell dot edu
  2010-05-28 11:36 ` [Bug middle-end/44307] " jsm28 at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: jay dot krell at cornell dot edu @ 2010-05-28 10:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jay dot krell at cornell dot edu  2010-05-28 10:48 -------
Here is another:
tree-chrec.h:131: warning: 'val' may be used uninitialized in this function


I'm using -disable-bootstrap.
I'm not sure that matters here but maybe.
 There isn't -Werror, compilation does succeed. Still, might be nice to
cleanup.

This the default gcc on MacOSX 10.5/x86.

jay$ gcc -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5493~1/src/configure --disable-checking
-enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=i686-apple-darwin9 --with-arch=apple --with-tune=generic
--host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5493)


-- 


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


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

* [Bug middle-end/44307] warning: may be used uninitialized in this function often building gcc
  2010-05-28 10:43 [Bug c/44307] New: warning: may be used uninitialized in this function often building gcc jay dot krell at cornell dot edu
  2010-05-28 10:45 ` [Bug c/44307] " rguenth at gcc dot gnu dot org
  2010-05-28 10:48 ` jay dot krell at cornell dot edu
@ 2010-05-28 11:36 ` jsm28 at gcc dot gnu dot org
  2010-06-04 15:56 ` manu at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2010-05-28 11:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jsm28 at gcc dot gnu dot org  2010-05-28 11:35 -------
Stop using "c" as the component for bugs that are obviously not front-end bugs.

In this case, you can see that none of the files mentioned are front-end files.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end


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


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

* [Bug middle-end/44307] warning: may be used uninitialized in this function often building gcc
  2010-05-28 10:43 [Bug c/44307] New: warning: may be used uninitialized in this function often building gcc jay dot krell at cornell dot edu
                   ` (2 preceding siblings ...)
  2010-05-28 11:36 ` [Bug middle-end/44307] " jsm28 at gcc dot gnu dot org
@ 2010-06-04 15:56 ` manu at gcc dot gnu dot org
  2010-06-04 16:21 ` jay dot krell at cornell dot edu
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-06-04 15:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from manu at gcc dot gnu dot org  2010-06-04 15:56 -------
Hi Jay,

-Wuninitialized is quite unreliable in old compilers and also we do not know
what patches Apple applies to its copy of GCC. This is why -Werror is not used
in the first stage of building GCC. We do not see these warnings with recent
GCC, so I guess they are bogus. If you find a real (potential) uninitialized
use, please reopen this PR and point us to the code. Otherwise, fixing this is
not worth the effort of anyone. There is a lot more interesting (and urgently
needed) work to do in GCC. I am sure Richard Guenther could have fixed a couple
of real bugs in the time it took him to read this PR ;).

Thanks for the report anyway.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


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


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

* [Bug middle-end/44307] warning: may be used uninitialized in this function often building gcc
  2010-05-28 10:43 [Bug c/44307] New: warning: may be used uninitialized in this function often building gcc jay dot krell at cornell dot edu
                   ` (3 preceding siblings ...)
  2010-06-04 15:56 ` manu at gcc dot gnu dot org
@ 2010-06-04 16:21 ` jay dot krell at cornell dot edu
  2010-06-04 16:23 ` manu at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: jay dot krell at cornell dot edu @ 2010-06-04 16:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jay dot krell at cornell dot edu  2010-06-04 16:20 -------
Then don't use when I -disable-bootstrap..


-- 


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


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

* [Bug middle-end/44307] warning: may be used uninitialized in this function often building gcc
  2010-05-28 10:43 [Bug c/44307] New: warning: may be used uninitialized in this function often building gcc jay dot krell at cornell dot edu
                   ` (4 preceding siblings ...)
  2010-06-04 16:21 ` jay dot krell at cornell dot edu
@ 2010-06-04 16:23 ` manu at gcc dot gnu dot org
  2010-06-04 16:30 ` jay dot krell at cornell dot edu
  2010-06-04 16:37 ` [Bug bootstrap/44307] do not enable warnings when building with the host compiler manu at gcc dot gnu dot org
  7 siblings, 0 replies; 10+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-06-04 16:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from manu at gcc dot gnu dot org  2010-06-04 16:22 -------
(In reply to comment #5)
> Then don't use when I -disable-bootstrap..
> 

Do you mean that -Werror is used when you disable-bootstrap? If so, I think
that is a bug. Or you mean to not use warnings? I think that would be a nice
enhancement, yes.


-- 


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


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

* [Bug middle-end/44307] warning: may be used uninitialized in this function often building gcc
  2010-05-28 10:43 [Bug c/44307] New: warning: may be used uninitialized in this function often building gcc jay dot krell at cornell dot edu
                   ` (5 preceding siblings ...)
  2010-06-04 16:23 ` manu at gcc dot gnu dot org
@ 2010-06-04 16:30 ` jay dot krell at cornell dot edu
  2010-06-04 16:37 ` [Bug bootstrap/44307] do not enable warnings when building with the host compiler manu at gcc dot gnu dot org
  7 siblings, 0 replies; 10+ messages in thread
From: jay dot krell at cornell dot edu @ 2010-06-04 16:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jay dot krell at cornell dot edu  2010-06-04 16:30 -------
I mean -Wuninitialized.
-Werror is already omitted.


-- 


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


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

* [Bug bootstrap/44307] do not enable warnings when building with the host compiler
  2010-05-28 10:43 [Bug c/44307] New: warning: may be used uninitialized in this function often building gcc jay dot krell at cornell dot edu
                   ` (6 preceding siblings ...)
  2010-06-04 16:30 ` jay dot krell at cornell dot edu
@ 2010-06-04 16:37 ` manu at gcc dot gnu dot org
  7 siblings, 0 replies; 10+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-06-04 16:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from manu at gcc dot gnu dot org  2010-06-04 16:36 -------
-Wuninitialized is enabled by -Wall (or perhaps -Wextra), not explicitly. I
think we should not enable any warnings when building with the host compiler,
unless the user requests them. It is probably faster and would produce less
clutter in the output. But I don't have enough time to provide a patch to fix
this, and I doubt any main developer considers this a priority.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
          Component|middle-end                  |bootstrap
         Resolution|WONTFIX                     |
            Summary|warning: may be used        |do not enable warnings when
                   |uninitialized in this       |building with the host
                   |function often building gcc |compiler


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


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

* [Bug bootstrap/44307] do not enable warnings when building with the host compiler
       [not found] <bug-44307-4@http.gcc.gnu.org/bugzilla/>
@ 2012-02-03 22:51 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-03 22:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-03 22:51:27 UTC ---
This is really expected and the reason why only stage2 and stage3 use -Werror
so closing as won't fix.

Note for cross compiling compiling with -Wall -W is useful and
--disable-bootstrap happens there.


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

end of thread, other threads:[~2012-02-03 22:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-28 10:43 [Bug c/44307] New: warning: may be used uninitialized in this function often building gcc jay dot krell at cornell dot edu
2010-05-28 10:45 ` [Bug c/44307] " rguenth at gcc dot gnu dot org
2010-05-28 10:48 ` jay dot krell at cornell dot edu
2010-05-28 11:36 ` [Bug middle-end/44307] " jsm28 at gcc dot gnu dot org
2010-06-04 15:56 ` manu at gcc dot gnu dot org
2010-06-04 16:21 ` jay dot krell at cornell dot edu
2010-06-04 16:23 ` manu at gcc dot gnu dot org
2010-06-04 16:30 ` jay dot krell at cornell dot edu
2010-06-04 16:37 ` [Bug bootstrap/44307] do not enable warnings when building with the host compiler manu at gcc dot gnu dot org
     [not found] <bug-44307-4@http.gcc.gnu.org/bugzilla/>
2012-02-03 22:51 ` 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).