public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/31279] Uninitialized warning for call-by-reference arguments with known intent(in)
       [not found] <bug-31279-4@http.gcc.gnu.org/bugzilla/>
@ 2012-02-02 17:49 ` pinskia at gcc dot gnu.org
  2013-06-25  9:10 ` dominiq at lps dot ens.fr
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-02 17:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-02-02
     Ever Confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-02 17:49:32 UTC ---
Confirmed.


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

* [Bug middle-end/31279] Uninitialized warning for call-by-reference arguments with known intent(in)
       [not found] <bug-31279-4@http.gcc.gnu.org/bugzilla/>
  2012-02-02 17:49 ` [Bug middle-end/31279] Uninitialized warning for call-by-reference arguments with known intent(in) pinskia at gcc dot gnu.org
@ 2013-06-25  9:10 ` dominiq at lps dot ens.fr
  2013-08-28  8:25 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-25  9:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Still no warning at revision 200371.


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

* [Bug middle-end/31279] Uninitialized warning for call-by-reference arguments with known intent(in)
       [not found] <bug-31279-4@http.gcc.gnu.org/bugzilla/>
  2012-02-02 17:49 ` [Bug middle-end/31279] Uninitialized warning for call-by-reference arguments with known intent(in) pinskia at gcc dot gnu.org
  2013-06-25  9:10 ` dominiq at lps dot ens.fr
@ 2013-08-28  8:25 ` rguenth at gcc dot gnu.org
  2020-05-19 20:03 ` msebor at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-08-28  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

Bug 31279 depends on bug 31094, which changed state.

Bug 31094 Summary: Support annotating function parameters as read-only and/or non-escaping
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31094

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


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

* [Bug middle-end/31279] Uninitialized warning for call-by-reference arguments with known intent(in)
       [not found] <bug-31279-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2013-08-28  8:25 ` rguenth at gcc dot gnu.org
@ 2020-05-19 20:03 ` msebor at gcc dot gnu.org
  2021-03-25 17:49 ` [Bug fortran/31279] " msebor at gcc dot gnu.org
  2022-08-29 13:14 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-05-19 20:03 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=10138

--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
In conjunction with attribute access (read_only) (which I presume is the moral
equivalent of INTENT(IN)), the patch I submitted for pr10138 puts in place the
infrastructure to implement this warning for FORTRAN as well.  All that it
should need is mapping INTENT(IN) to the attribute.

https://gcc.gnu.org/pipermail/gcc-patches/2020-May/545856.html

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

* [Bug fortran/31279] Uninitialized warning for call-by-reference arguments with known intent(in)
       [not found] <bug-31279-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-05-19 20:03 ` msebor at gcc dot gnu.org
@ 2021-03-25 17:49 ` msebor at gcc dot gnu.org
  2022-08-29 13:14 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-03-25 17:49 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

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

--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC added the attributes mentioned in comment #4 under the name access -- see
below.  Getting the middle end to issue a warning for the cases described in
comment #0 should be a matter of the Fortran front end making use of the
attribute.

$ cat x.c && gcc -S -Wall x.c
__attribute__ ((access (read_only, 1))) void f (int*);

void g (void)
{
  int x;
  f (&x);
}
x.c: In function ‘g’:
x.c:6:3: warning: ‘x’ is used uninitialized [-Wuninitialized]
    6 |   f (&x);
      |   ^~~~~~
x.c:1:46: note: in a call to ‘f’ declared with attribute ‘access (read_only,
1)’ here
    1 | __attribute__ ((access (read_only, 1))) void f (int*);
      |                                              ^
x.c:5:7: note: ‘x’ declared here
    5 |   int x;
      |       ^

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

* [Bug fortran/31279] Uninitialized warning for call-by-reference arguments with known intent(in)
       [not found] <bug-31279-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-03-25 17:49 ` [Bug fortran/31279] " msebor at gcc dot gnu.org
@ 2022-08-29 13:14 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-29 13:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
The original testcase hides everything behind array descriptors, even with
unrolling and vectorization disabled we end up with

  <bb 2> [local count: 214748368]:
  parm.0.data = &alist[0];
  parm.0.offset = -1;
  parm.0.dtype.elem_len = 4;
  MEM <unsigned long> [(void *)&parm.0 + 24B] = 1103806595072;
  parm.0.span = 4;
  parm.0.dim[0].stride = 1;
  parm.0.dim[0].lbound = 1;
  parm.0.dim[0].ubound = 4;
  atmp.1.data = &A.2;
  atmp.1.offset = 0;
  atmp.1.dtype.elem_len = 4;
  MEM <unsigned long> [(void *)&atmp.1 + 24B] = 1103806595072;
  atmp.1.span = 4;
  atmp.1.dim[0].stride = 1;
  atmp.1.dim[0].lbound = 0;
  atmp.1.dim[0].ubound = 3;
  _gfortran_cshift0_4 (&atmp.1, &parm.0, &C.4234, 0B);

the frontend might set the fnspec correctly to r (read-only, even transitively)
which we might use here but then the actual use is the intrinsic and the
fnspec does not say that the function acrually reads from the uninitialized
storage.

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-31279-4@http.gcc.gnu.org/bugzilla/>
2012-02-02 17:49 ` [Bug middle-end/31279] Uninitialized warning for call-by-reference arguments with known intent(in) pinskia at gcc dot gnu.org
2013-06-25  9:10 ` dominiq at lps dot ens.fr
2013-08-28  8:25 ` rguenth at gcc dot gnu.org
2020-05-19 20:03 ` msebor at gcc dot gnu.org
2021-03-25 17:49 ` [Bug fortran/31279] " msebor at gcc dot gnu.org
2022-08-29 13:14 ` rguenth 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).