public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/57149] New: [4.8 Regression] wrong -Wmaybe-uninitialized warning with -Os
@ 2013-05-02 19:33 doko at gcc dot gnu.org
  2013-05-03  8:58 ` [Bug tree-optimization/57149] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: doko at gcc dot gnu.org @ 2013-05-02 19:33 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 57149
           Summary: [4.8 Regression] wrong -Wmaybe-uninitialized warning
                    with -Os
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: doko@gcc.gnu.org


Created attachment 30007
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30007
preprocessed source

seen when building a driver in an arm linux 3.4 kernel, the warning shows up
when building with -Os, but not when building with -O[g123], works with all
optimization levels in 4.7.3.

$ gcc -Wall -Wno-unused-but-set-variable -Os -marm -mapcs -mabi=aapcs-linux
-march=armv7-a -msoft-float -g -c ci13xxx_msm.i)
In file included from drivers/usb/gadget/ci13xxx_msm.c:21:0:
drivers/usb/gadget/ci13xxx_msm.c: In function 'msm_udc_irq':
drivers/usb/gadget/ci13xxx_udc.c:2544:13: warning: 'err' may be used
uninitialized in this function [-Wmaybe-uninitialized]
    dbg_event(_usb_addr(mEp), "ERROR", err);
             ^
drivers/usb/gadget/ci13xxx_udc.c:2357:23: note: 'err' was declared here
   int type, num, dir; int err = -EINVAL;
                       ^
$ gcc -Wall -Wno-unused-but-set-variable -Og -marm -mapcs -mabi=aapcs-linux
-march=armv7-a -msoft-float -g -c ci13xxx_msm.i
$


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

* [Bug tree-optimization/57149] [4.8 Regression] wrong -Wmaybe-uninitialized warning with -Os
  2013-05-02 19:33 [Bug tree-optimization/57149] New: [4.8 Regression] wrong -Wmaybe-uninitialized warning with -Os doko at gcc dot gnu.org
  2013-05-03  8:58 ` [Bug tree-optimization/57149] " rguenth at gcc dot gnu.org
@ 2013-05-03  8:58 ` rguenth at gcc dot gnu.org
  2013-05-03  8:59 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-05-03  8:58 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-05-03
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2013-05-03 08:58:10 UTC ---
Confirmed on i?86-linux.  The code may be confused by the delegate label.


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

* [Bug tree-optimization/57149] [4.8 Regression] wrong -Wmaybe-uninitialized warning with -Os
  2013-05-02 19:33 [Bug tree-optimization/57149] New: [4.8 Regression] wrong -Wmaybe-uninitialized warning with -Os doko at gcc dot gnu.org
@ 2013-05-03  8:58 ` rguenth at gcc dot gnu.org
  2013-05-03  8:58 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-05-03  8:58 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.1


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

* [Bug tree-optimization/57149] [4.8 Regression] wrong -Wmaybe-uninitialized warning with -Os
  2013-05-02 19:33 [Bug tree-optimization/57149] New: [4.8 Regression] wrong -Wmaybe-uninitialized warning with -Os doko at gcc dot gnu.org
  2013-05-03  8:58 ` [Bug tree-optimization/57149] " rguenth at gcc dot gnu.org
  2013-05-03  8:58 ` rguenth at gcc dot gnu.org
@ 2013-05-03  8:59 ` rguenth at gcc dot gnu.org
  2013-05-07  7:01 ` [Bug tree-optimization/57149] [4.8/4.9 " jakub at gcc dot gnu.org
  2013-05-07 10:40 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-05-03  8:59 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> 2013-05-03 08:59:08 UTC ---
Created attachment 30015
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30015
adjusted testcase

preprocessed source that also builds and fails on i?86-linux.


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

* [Bug tree-optimization/57149] [4.8/4.9 Regression] wrong -Wmaybe-uninitialized warning with -Os
  2013-05-02 19:33 [Bug tree-optimization/57149] New: [4.8 Regression] wrong -Wmaybe-uninitialized warning with -Os doko at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-05-03  8:59 ` rguenth at gcc dot gnu.org
@ 2013-05-07  7:01 ` jakub at gcc dot gnu.org
  2013-05-07 10:40 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-05-07  7:01 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-05-07 07:00:58 UTC ---
The difference in *.uninit before/after that commit is small, just:
@@ -78,7 +79,7 @@ fn4 (struct F * x, unsigned int k)
     goto <bb 7>;

   <bb 7>:
-  # retval_25 = PHI <0(3), retval_26(6)>
+  # err_25 = PHI <0(3), retval_26(6)>
   _12 = y_9->f;
   if (_12 == 0)
     goto <bb 9>;
@@ -89,17 +90,17 @@ fn4 (struct F * x, unsigned int k)
   goto <bb 13>;

   <bb 9>:
-  if (retval_25 > 0)
+  if (err_25 > 0)
     goto <bb 10>;
   else
     goto <bb 11>;

   <bb 10>:
-  retval_14 = fn0 ();
+  err_14 = fn0 ();

   <bb 11>:
-  # retval_2 = PHI <retval_25(9), retval_14(10)>
-  if (retval_2 < 0)
+  # err_2 = PHI <err_25(9), err_14(10)>
+  if (err_2 < 0)
     goto <bb 12>;
   else
     goto <bb 8>;

and in both cases there is
   # retval_26 = PHI <retval_27(D)(4), retval_21(5)>
that is the reason for the warning.  The important thing is that the retval
decl has TREE_NO_WARNING set  (because of the retval = retval uninit warning
suppression), while err doesn't.

Trying a patch not to consider TREE_NO_WARNING SSA_NAME_VARs
ssa_undefined_value_p when inside of tree-ssa-uninit.c now.


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

* [Bug tree-optimization/57149] [4.8/4.9 Regression] wrong -Wmaybe-uninitialized warning with -Os
  2013-05-02 19:33 [Bug tree-optimization/57149] New: [4.8 Regression] wrong -Wmaybe-uninitialized warning with -Os doko at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-05-07  7:01 ` [Bug tree-optimization/57149] [4.8/4.9 " jakub at gcc dot gnu.org
@ 2013-05-07 10:40 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-05-07 10:40 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-05-07 10:40:10 UTC ---
Author: jakub
Date: Tue May  7 10:30:13 2013
New Revision: 198671

URL: http://gcc.gnu.org/viewcvs?rev=198671&root=gcc&view=rev
Log:
    PR tree-optimization/57149
    * tree-ssa-uninit.c (uninit_undefined_value_p): New inline.
    (can_skip_redundant_opnd, compute_uninit_opnds_pos,
    collect_phi_def_edges, execute_late_warn_uninitialized): Use
    uninit_undefined_value_p instead of ssa_undefined_value_p.

    * gcc.dg/pr57149.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr57149.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-uninit.c

Author: jakub
Date: Tue May  7 10:32:41 2013
New Revision: 198672

URL: http://gcc.gnu.org/viewcvs?rev=198672&root=gcc&view=rev
Log:
    PR tree-optimization/57149
    * tree-ssa-uninit.c (uninit_undefined_value_p): New inline.
    (can_skip_redundant_opnd, compute_uninit_opnds_pos,
    collect_phi_def_edges, execute_late_warn_uninitialized): Use
    uninit_undefined_value_p instead of ssa_undefined_value_p.

    * gcc.dg/pr57149.c: New test.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/pr57149.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_8-branch/gcc/tree-ssa-uninit.c


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

end of thread, other threads:[~2013-05-07 10:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-02 19:33 [Bug tree-optimization/57149] New: [4.8 Regression] wrong -Wmaybe-uninitialized warning with -Os doko at gcc dot gnu.org
2013-05-03  8:58 ` [Bug tree-optimization/57149] " rguenth at gcc dot gnu.org
2013-05-03  8:58 ` rguenth at gcc dot gnu.org
2013-05-03  8:59 ` rguenth at gcc dot gnu.org
2013-05-07  7:01 ` [Bug tree-optimization/57149] [4.8/4.9 " jakub at gcc dot gnu.org
2013-05-07 10:40 ` jakub 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).