public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29459]  New: Spurious warning about uninitialized optional arguments
@ 2006-10-13 14:16 vivekrao4 at yahoo dot com
  2006-11-25 19:41 ` [Bug fortran/29459] " fxcoudert at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: vivekrao4 at yahoo dot com @ 2006-10-13 14:16 UTC (permalink / raw)
  To: gcc-bugs

gfortran -c -Wall -O1 gfort_warnings.f90 

using gcc version 4.2.0 20061011 (experimental) on Windows XP

for the code

module foo_mod
implicit none
contains
subroutine print_sub(fmt_acf,iu,labels)
character (len=*), intent(in), optional :: fmt_acf
integer          , intent(in), optional :: iu
character (len=*), intent(in), optional :: labels(:)
if (present(iu)) then
   print*,iu
end if
if (present(fmt_acf)) then
   print*,fmt_acf
end if
if (present(labels)) then
   write (*,*) labels
end if
end subroutine print_sub
!
end module foo_mod

produces the spurious warnings
gfort_warnings.f90: In function 'print_sub':
gfort_warnings.f90:4: warning: 'stride.1' may be used uninitialized in this
function
gfort_warnings.f90:4: warning: 'ubound.0' may be used uninitialized in this
function
gfort_warnings.f90:4: warning: 'labels.0' may be used uninitialized in this
function
gfort_warnings.f90:4: warning: '<anonymous>' may be used uninitialized in this
function


-- 
           Summary: Spurious warning about uninitialized optional arguments
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vivekrao4 at yahoo dot com


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


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

* [Bug fortran/29459] Spurious warning about uninitialized optional arguments
  2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
@ 2006-11-25 19:41 ` fxcoudert at gcc dot gnu dot org
  2007-01-31 23:15 ` fxcoudert at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-11-25 19:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2006-11-25 19:41 -------
Confirmed. You can get rid of a few of those with:

Index: trans-decl.c
===================================================================
--- trans-decl.c        (revision 119204)
+++ trans-decl.c        (working copy)
@@ -627,20 +627,30 @@
   for (dim = 0; dim < GFC_TYPE_ARRAY_RANK (type); dim++)
     {
       if (GFC_TYPE_ARRAY_LBOUND (type, dim) == NULL_TREE)
-        GFC_TYPE_ARRAY_LBOUND (type, dim) = create_index_var ("lbound", nest);
+       {
+          GFC_TYPE_ARRAY_LBOUND (type, dim) = create_index_var ("lbound",
nest);
+         TREE_NO_WARNING (GFC_TYPE_ARRAY_LBOUND (type, dim)) = 1;
+       }
       /* Don't try to use the unknown bound for assumed shape arrays.  */
       if (GFC_TYPE_ARRAY_UBOUND (type, dim) == NULL_TREE
           && (sym->as->type != AS_ASSUMED_SIZE
               || dim < GFC_TYPE_ARRAY_RANK (type) - 1))
-        GFC_TYPE_ARRAY_UBOUND (type, dim) = create_index_var ("ubound", nest);
+       {
+          GFC_TYPE_ARRAY_UBOUND (type, dim) = create_index_var ("ubound",
nest);
+         TREE_NO_WARNING (GFC_TYPE_ARRAY_UBOUND (type, dim)) = 1;
+       }

       if (GFC_TYPE_ARRAY_STRIDE (type, dim) == NULL_TREE)
-        GFC_TYPE_ARRAY_STRIDE (type, dim) = create_index_var ("stride", nest);
+       {
+          GFC_TYPE_ARRAY_STRIDE (type, dim) = create_index_var ("stride",
nest);
+         TREE_NO_WARNING (GFC_TYPE_ARRAY_STRIDE (type, dim)) = 1;
+       }
     }
   if (GFC_TYPE_ARRAY_OFFSET (type) == NULL_TREE)
     {
       GFC_TYPE_ARRAY_OFFSET (type) = gfc_create_var_np (gfc_array_index_type,
                                                        "offset");
+      TREE_NO_WARNING (GFC_TYPE_ARRAY_OFFSET (type)) = 1;
       if (nest)
        gfc_add_decl_to_parent_function (GFC_TYPE_ARRAY_OFFSET (type));
       else
@@ -649,7 +659,10 @@

   if (GFC_TYPE_ARRAY_SIZE (type) == NULL_TREE
       && sym->as->type != AS_ASSUMED_SIZE)
-    GFC_TYPE_ARRAY_SIZE (type) = create_index_var ("size", nest);
+    {
+      GFC_TYPE_ARRAY_SIZE (type) = create_index_var ("size", nest);
+      TREE_NO_WARNING (GFC_TYPE_ARRAY_SIZE (type)) = 1;
+    }

   if (POINTER_TYPE_P (type))
     {


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2006-11-25 19:41:20
               date|                            |


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


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

* [Bug fortran/29459] Spurious warning about uninitialized optional arguments
  2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
  2006-11-25 19:41 ` [Bug fortran/29459] " fxcoudert at gcc dot gnu dot org
@ 2007-01-31 23:15 ` fxcoudert at gcc dot gnu dot org
  2007-07-04  7:44 ` fxcoudert at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-01-31 23:15 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |fxcoudert at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-11-25 19:41:20         |2007-01-31 23:15:40
               date|                            |


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


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

* [Bug fortran/29459] Spurious warning about uninitialized optional arguments
  2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
                   ` (2 preceding siblings ...)
  2007-07-04  7:44 ` fxcoudert at gcc dot gnu dot org
@ 2007-07-04  7:44 ` fxcoudert at gcc dot gnu dot org
  2007-07-04  7:50 ` fxcoudert at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-07-04  7:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2007-07-04 07:43 -------
*** Bug 31688 has been marked as a duplicate of this bug. ***


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org


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


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

* [Bug fortran/29459] Spurious warning about uninitialized optional arguments
  2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
  2006-11-25 19:41 ` [Bug fortran/29459] " fxcoudert at gcc dot gnu dot org
  2007-01-31 23:15 ` fxcoudert at gcc dot gnu dot org
@ 2007-07-04  7:44 ` fxcoudert at gcc dot gnu dot org
  2007-07-04  7:44 ` fxcoudert at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-07-04  7:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from fxcoudert at gcc dot gnu dot org  2007-07-04 07:44 -------
(In reply to comment #2)
> *** Bug 31688 has been marked as a duplicate of this bug. ***

Code from PR31688:

MODULE test
  IMPLICIT NONE
CONTAINS
  SUBROUTINE overlap(s, lds, pab, force_a)
    INTEGER, INTENT(IN)                         :: lds
    REAL, DIMENSION(lds, lds, *), INTENT(INOUT) :: s
    REAL, DIMENSION(:), INTENT(IN), OPTIONAL    :: pab
    REAL, INTENT(OUT)                           :: force_a

    if(.not.present(pab)) return
    force_a = pab(1)*s(1,1,1)
  END SUBROUTINE
END MODULE test


-- 


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


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

* [Bug fortran/29459] Spurious warning about uninitialized optional arguments
  2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
                   ` (3 preceding siblings ...)
  2007-07-04  7:44 ` fxcoudert at gcc dot gnu dot org
@ 2007-07-04  7:50 ` fxcoudert at gcc dot gnu dot org
  2007-07-09 22:01 ` fxcoudert at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-07-04  7:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from fxcoudert at gcc dot gnu dot org  2007-07-04 07:50 -------
Updated partial patch:

Index: trans-array.c
===================================================================
--- trans-array.c       (revision 126249)
+++ trans-array.c       (working copy)
@@ -1695,6 +1695,7 @@
   desc = ss->data.info.descriptor;
   offset = gfc_index_zero_node;
   offsetvar = gfc_create_var_np (gfc_array_index_type, "offset");
+  TREE_NO_WARNING (offsetvar) = 1;
   TREE_USED (offsetvar) = 0;
   gfc_trans_array_constructor_value (&loop->pre, type, desc, c,
                                     &offset, &offsetvar, dynamic);
Index: trans-decl.c
===================================================================
--- trans-decl.c        (revision 126249)
+++ trans-decl.c        (working copy)
@@ -633,20 +633,31 @@
   for (dim = 0; dim < GFC_TYPE_ARRAY_RANK (type); dim++)
     {
       if (GFC_TYPE_ARRAY_LBOUND (type, dim) == NULL_TREE)
-        GFC_TYPE_ARRAY_LBOUND (type, dim) = create_index_var ("lbound", nest);
+       {
+          GFC_TYPE_ARRAY_LBOUND (type, dim) = create_index_var ("lbound",
nest);
+         TREE_NO_WARNING (GFC_TYPE_ARRAY_LBOUND (type, dim)) = 1;
+       }
       /* Don't try to use the unknown bound for assumed shape arrays.  */
       if (GFC_TYPE_ARRAY_UBOUND (type, dim) == NULL_TREE
           && (sym->as->type != AS_ASSUMED_SIZE
               || dim < GFC_TYPE_ARRAY_RANK (type) - 1))
-        GFC_TYPE_ARRAY_UBOUND (type, dim) = create_index_var ("ubound", nest);
+       {
+          GFC_TYPE_ARRAY_UBOUND (type, dim) = create_index_var ("ubound",
nest);
+         TREE_NO_WARNING (GFC_TYPE_ARRAY_UBOUND (type, dim)) = 1;
+       }

       if (GFC_TYPE_ARRAY_STRIDE (type, dim) == NULL_TREE)
-        GFC_TYPE_ARRAY_STRIDE (type, dim) = create_index_var ("stride", nest);
+       {
+          GFC_TYPE_ARRAY_STRIDE (type, dim) = create_index_var ("stride",
nest);
+         TREE_NO_WARNING (GFC_TYPE_ARRAY_STRIDE (type, dim)) = 1;
+       }
     }
   if (GFC_TYPE_ARRAY_OFFSET (type) == NULL_TREE)
     {
       GFC_TYPE_ARRAY_OFFSET (type) = gfc_create_var_np (gfc_array_index_type,
                                                        "offset");
+      TREE_NO_WARNING (GFC_TYPE_ARRAY_OFFSET (type)) = 1;
+
       if (nest)
        gfc_add_decl_to_parent_function (GFC_TYPE_ARRAY_OFFSET (type));
       else
@@ -655,7 +666,10 @@

   if (GFC_TYPE_ARRAY_SIZE (type) == NULL_TREE
       && sym->as->type != AS_ASSUMED_SIZE)
-    GFC_TYPE_ARRAY_SIZE (type) = create_index_var ("size", nest);
+    {
+      GFC_TYPE_ARRAY_SIZE (type) = create_index_var ("size", nest);
+      TREE_NO_WARNING (GFC_TYPE_ARRAY_SIZE (type)) = 1;
+    }

   if (POINTER_TYPE_P (type))
     {


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug fortran/29459] Spurious warning about uninitialized optional arguments
  2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
                   ` (4 preceding siblings ...)
  2007-07-04  7:50 ` fxcoudert at gcc dot gnu dot org
@ 2007-07-09 22:01 ` fxcoudert at gcc dot gnu dot org
  2007-07-09 22:03 ` fxcoudert at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-07-09 22:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from fxcoudert at gcc dot gnu dot org  2007-07-09 22:01 -------
Subject: Bug 29459

Author: fxcoudert
Date: Mon Jul  9 22:00:52 2007
New Revision: 126496

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126496
Log:
        PR fortran/29459
        * trans-array.c (gfc_trans_array_constructor): Mark offset field
        with TREE_NO_WARNING.
        * trans-decl.c (gfc_build_qualified_array): Mark lbound, ubound,
        stride and size variables with TREE_NO_WARNING.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/fortran/trans-decl.c


-- 


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


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

* [Bug fortran/29459] Spurious warning about uninitialized optional arguments
  2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
                   ` (5 preceding siblings ...)
  2007-07-09 22:01 ` fxcoudert at gcc dot gnu dot org
@ 2007-07-09 22:03 ` fxcoudert at gcc dot gnu dot org
  2007-08-14 14:10 ` fxcoudert at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-07-09 22:03 UTC (permalink / raw)
  To: gcc-bugs

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



------- Comment #6 from fxcoudert at gcc dot gnu dot org  2007-07-09 22:03 -------
With the initial testcase:

module foo_mod
implicit none
contains
subroutine print_sub(fmt_acf,iu,labels)
character (len=*), intent(in), optional :: fmt_acf
integer          , intent(in), optional :: iu
character (len=*), intent(in), optional :: labels(:)
if (present(iu)) then
   print*,iu
end if
if (present(fmt_acf)) then
   print*,fmt_acf
end if
if (present(labels)) then
   write (*,*) labels
end if
end subroutine print_sub
!
end module foo_mod

we still have the following warning with -O1 -Wall:
u.f90: In function ‘print_sub’:
u.f90:4: warning: ‘<anonymous>’ may be used uninitialized in this function


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|fxcoudert at gcc dot gnu dot|unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW
           Keywords|patch                       |


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


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

* [Bug fortran/29459] Spurious warning about uninitialized optional arguments
  2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
                   ` (6 preceding siblings ...)
  2007-07-09 22:03 ` fxcoudert at gcc dot gnu dot org
@ 2007-08-14 14:10 ` fxcoudert at gcc dot gnu dot org
  2007-08-14 15:26 ` fxcoudert at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-08-14 14:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from fxcoudert at gcc dot gnu dot org  2007-08-14 14:10 -------
Reduced testcase:

subroutine print_sub(l, labels)
  logical :: l
  character (len=*), optional :: labels(1)
  if (l) call foo
  if (present(labels)) then
    print *, labels(1)
  end if
end

The logical and corresponding if clause are only here to prevent the optimizer
being too clever, but any non-trivially-dead code works as well. The tree dump
for this is along the lines of:

print_sub (l, labels, _labels)
{
  char[1][1:_labels] * labels.0;

  if (labels != 0B)
    labels.0 = (char[1][1:_labels] *) labels;

  if (*l)
    foo()

  if (labels != 0B)
    {
      _gfortran_transfer_character (&dt_parm.0, &(*labels.0)[0][1]{lb: 1 sz:
1}, _labels);
      _gfortran_st_write_done (&dt_parm.0);
    }
}


I suspect that '<anonymous>' is labels.0 (though it *has* a name!), because
it's set in the first if-block and used in the second. If the optimizer is
intelligent enough to remove the code in-between, the warning disappears.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |fxcoudert at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-01-31 23:15:40         |2007-08-14 14:10:15
               date|                            |


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


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

* [Bug fortran/29459] Spurious warning about uninitialized optional arguments
  2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
                   ` (7 preceding siblings ...)
  2007-08-14 14:10 ` fxcoudert at gcc dot gnu dot org
@ 2007-08-14 15:26 ` fxcoudert at gcc dot gnu dot org
  2007-08-15  9:16 ` [Bug fortran/29459] Spurious warnings about anonymous variables fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-08-14 15:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from fxcoudert at gcc dot gnu dot org  2007-08-14 15:26 -------
(In reply to comment #7)
> I suspect that '<anonymous>' is labels.0 (though it *has* a name!)

Well, that was wrong. If you look at the gimple tree (004t.gimple), it contains
the following:

print_sub (l, labels, _labels)
{
  <unnamed-unsigned:64> D.1377;
  int4 D.1378;
  <unnamed-unsigned:64> D.1379;
  logical4 D.1380;
  <unnamed-unsigned:64> D.1381;
  char * D.1382;
  char[1][1:_labels] * labels.0;
  bit_size_type D.1373;
  <unnamed-unsigned:64> D.1374;
  bit_size_type D.1375;
  <unnamed-unsigned:64> D.1376;

  if (labels != 0B)
    {
      D.1377 = (<unnamed-unsigned:64>) _labels;
      D.1373 = D.1377 * 8;
      D.1378 = _labels + -1;
      D.1379 = (<unnamed-unsigned:64>) D.1378;
      D.1374 = D.1379 + 1;
      D.1377 = (<unnamed-unsigned:64>) _labels;
      D.1375 = D.1377 * 8;
      D.1378 = _labels + -1;
      D.1379 = (<unnamed-unsigned:64>) D.1378;
      D.1376 = D.1379 + 1;
      labels.0 = (char[1][1:_labels] *) labels;

  [...]

  if (labels != 0B)
    {
      D.1381 = D.1374;
      D.1382 = &(*labels.0)[0]{lb: 0 sz: NON_LVALUE_EXPR <D.1381>}[1]{lb: 1 sz:
1};
      _gfortran_transfer_character (&dt_parm.0, D.1382, _labels);
      _gfortran_st_write_done (&dt_parm.0);
    }

So, now, my guess is that our anonymous is D.1374. But the thing is, I looked
through trans-array.c and trans-decl.c, and I can't find the place where it's
generated!


-- 


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


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

* [Bug fortran/29459] Spurious warnings about anonymous variables
  2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
                   ` (8 preceding siblings ...)
  2007-08-14 15:26 ` fxcoudert at gcc dot gnu dot org
@ 2007-08-15  9:16 ` fxcoudert at gcc dot gnu dot org
  2007-08-15 12:39 ` fxcoudert at gcc dot gnu dot org
  2007-08-15 12:40 ` fxcoudert at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-08-15  9:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from fxcoudert at gcc dot gnu dot org  2007-08-15 09:16 -------
OK, I've found the culprit: the variable is created in
gfc_trans_vla_one_sizepos(). However, it makes no sense to issue warnings about
anonymous variables, since these are emitted by the front-end for internal
business, and don't refer to user code. Thus, we can simply get rid of it as a
whole, with:

Index: trans.c
===================================================================
--- trans.c     (revision 127490)
+++ trans.c     (working copy)
@@ -102,7 +102,15 @@ remove_suffix (char *name, int len)
 tree
 gfc_create_var_np (tree type, const char *prefix)
 {
-  return create_tmp_var_raw (type, prefix);
+  tree t;
+  
+  t = create_tmp_var_raw (type, prefix);
+
+  /* No warnings for anonymous variables.  */
+  if (prefix == NULL)
+    TREE_NO_WARNING (t) = 1;
+
+  return t;
 }




-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
            Summary|Spurious warning about      |Spurious warnings about
                   |uninitialized optional      |anonymous variables
                   |arguments                   |
   Target Milestone|---                         |4.3.0


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


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

* [Bug fortran/29459] Spurious warnings about anonymous variables
  2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
                   ` (9 preceding siblings ...)
  2007-08-15  9:16 ` [Bug fortran/29459] Spurious warnings about anonymous variables fxcoudert at gcc dot gnu dot org
@ 2007-08-15 12:39 ` fxcoudert at gcc dot gnu dot org
  2007-08-15 12:40 ` fxcoudert at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-08-15 12:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from fxcoudert at gcc dot gnu dot org  2007-08-15 12:39 -------
Subject: Bug 29459

Author: fxcoudert
Date: Wed Aug 15 12:39:18 2007
New Revision: 127513

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127513
Log:
        PR fortran/29459
        * trans.c (gfc_create_var_np): Do not emit warnings for
        anonymous variables.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans.c


-- 


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


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

* [Bug fortran/29459] Spurious warnings about anonymous variables
  2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
                   ` (10 preceding siblings ...)
  2007-08-15 12:39 ` fxcoudert at gcc dot gnu dot org
@ 2007-08-15 12:40 ` fxcoudert at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-08-15 12:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from fxcoudert at gcc dot gnu dot org  2007-08-15 12:39 -------
Fixed.


-- 

fxcoudert at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-08-15 12:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-13 14:16 [Bug fortran/29459] New: Spurious warning about uninitialized optional arguments vivekrao4 at yahoo dot com
2006-11-25 19:41 ` [Bug fortran/29459] " fxcoudert at gcc dot gnu dot org
2007-01-31 23:15 ` fxcoudert at gcc dot gnu dot org
2007-07-04  7:44 ` fxcoudert at gcc dot gnu dot org
2007-07-04  7:44 ` fxcoudert at gcc dot gnu dot org
2007-07-04  7:50 ` fxcoudert at gcc dot gnu dot org
2007-07-09 22:01 ` fxcoudert at gcc dot gnu dot org
2007-07-09 22:03 ` fxcoudert at gcc dot gnu dot org
2007-08-14 14:10 ` fxcoudert at gcc dot gnu dot org
2007-08-14 15:26 ` fxcoudert at gcc dot gnu dot org
2007-08-15  9:16 ` [Bug fortran/29459] Spurious warnings about anonymous variables fxcoudert at gcc dot gnu dot org
2007-08-15 12:39 ` fxcoudert at gcc dot gnu dot org
2007-08-15 12:40 ` fxcoudert 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).