public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34721] Output statements fool the -Wuninitialized option
       [not found] <bug-34721-4@http.gcc.gnu.org/bugzilla/>
@ 2015-10-18 20:33 ` dominiq at lps dot ens.fr
  2022-08-29 13:16 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-18 20:33 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arnaud02 at users dot sourceforge.
                   |                            |net

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
*** Bug 50331 has been marked as a duplicate of this bug. ***


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

* [Bug fortran/34721] Output statements fool the -Wuninitialized option
       [not found] <bug-34721-4@http.gcc.gnu.org/bugzilla/>
  2015-10-18 20:33 ` [Bug fortran/34721] Output statements fool the -Wuninitialized option dominiq at lps dot ens.fr
@ 2022-08-29 13:16 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-29 13:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
really duplicate of PR19430

*** This bug has been marked as a duplicate of bug 19430 ***

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

* [Bug fortran/34721] Output statements fool the -Wuninitialized option
  2008-01-09  0:05 [Bug fortran/34721] New: " dominiq at lps dot ens dot fr
  2008-01-10 14:47 ` [Bug fortran/34721] " manu at gcc dot gnu dot org
@ 2008-01-10 15:39 ` burnus at gcc dot gnu dot org
  1 sibling, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-10 15:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2008-01-10 15:08 -------
Related to PR 31094, PR 31279, and PR 23169.


-- 


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


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

* [Bug fortran/34721] Output statements fool the -Wuninitialized option
  2008-01-09  0:05 [Bug fortran/34721] New: " dominiq at lps dot ens dot fr
@ 2008-01-10 14:47 ` manu at gcc dot gnu dot org
  2008-01-10 15:39 ` burnus at gcc dot gnu dot org
  1 sibling, 0 replies; 4+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-01-10 14:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from manu at gcc dot gnu dot org  2008-01-10 14:07 -------
This is an example that shows that small differences in code lead to quite
different SSA representations. Without print we have a PHI node, where one of
the operands is the uninitialized value, so we warn. However, with the print
statement, we don't generate such PHI node, so we don't warn:

* With the print statement:

  # BLOCK 7, starting at line 5
  # PRED: 5 (false) 6 (fallthru)
  # STORES:  { dt_parm.5D.883 }
  [pr34721.f90 : 5] dt_parm.5D.883.commonD.821.filenameD.743 ={v}
&"pr34721.f90"[1]{lb: 1 sz: 1};
  # STORES:  { dt_parm.5D.883 }
  [pr34721.f90 : 5] dt_parm.5D.883.commonD.821.lineD.744 ={v} 5;
  # STORES:  { dt_parm.5D.883 }
  [pr34721.f90 : 5] dt_parm.5D.883.commonD.821.flagsD.741 ={v} 128;
  # STORES:  { dt_parm.5D.883 }
  [pr34721.f90 : 5] dt_parm.5D.883.commonD.821.unitD.742 ={v} 6;
  [pr34721.f90 : 5] _gfortran_st_write (&dt_parm.5D.883);
  [pr34721.f90 : 5] _gfortran_transfer_integer (&dt_parm.5D.883, &nD.872, 4); 
<== PASSED BY REFERENCE!!
  [pr34721.f90 : 5] _gfortran_st_write_done (&dt_parm.5D.883);
  # LOADS:  { nD.872 }
  [pr34721.f90 : 6] D.884_31 = nD.872;    <===== NO PHI NODE!!
  [pr34721.f90 : 6] iD.871_32 = 1;
  [pr34721.f90 : 6] if (iD.871_32 <= D.884_31)
    goto <bb 8>;
  else
    goto <bb 9>;
  # SUCC: 8 (true) 9 (false)

* Without the print statement

  # BLOCK 7, starting at line 6
  # PRED: 5 (false) 6 (fallthru)
  # nD.872_2 = PHI <nD.872_26(D)(5), nD.872_32(6)>   <== PHI NODE WITH
UNINITIALIZED VALUE!!
  [pr34721.f90 : 6] D.883_33 = nD.872_2;
  [pr34721.f90 : 6] iD.871_34 = 1;
  [pr34721.f90 : 6] if (iD.871_34 <= D.883_33)
    goto <bb 8>;
  else
    goto <bb 9>;
  # SUCC: 8 (true) 9 (false)


I have no idea why "print" generates loads/stores but if the variable is passed
by reference to a function, it is very risky to warn, since the function may
initialize the variable.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-10 14:07:44
               date|                            |


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


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

end of thread, other threads:[~2022-08-29 13:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-34721-4@http.gcc.gnu.org/bugzilla/>
2015-10-18 20:33 ` [Bug fortran/34721] Output statements fool the -Wuninitialized option dominiq at lps dot ens.fr
2022-08-29 13:16 ` rguenth at gcc dot gnu.org
2008-01-09  0:05 [Bug fortran/34721] New: " dominiq at lps dot ens dot fr
2008-01-10 14:47 ` [Bug fortran/34721] " manu at gcc dot gnu dot org
2008-01-10 15:39 ` burnus at gcc dot gnu dot 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).