public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/33522]  New: Incorrect warning messages about uninitialized variables
@ 2007-09-21 19:24 dir at lanl dot gov
  2007-09-21 19:25 ` [Bug fortran/33522] " dir at lanl dot gov
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dir at lanl dot gov @ 2007-09-21 19:24 UTC (permalink / raw)
  To: gcc-bugs

These incorrect messages have been appearing lately. The variables are always
and only accessed in the save branch of the switch statements - so they will
never and can never be used uninitialized.


[dranta:~/tests/gfortran-D] dir% gfortran -c -O2 -Wuninitialized
module_files.f90
module_files.f90: In function 'my_sio_file_read_common':
module_files.f90:36: warning: 'scratch_r8.dim[1].stride' may be used
uninitialized in this function
module_files.f90:36: warning: 'scratch_r8.offset' may be used uninitialized in
this function
module_files.f90:35: warning: 'scratch_i4.dim[1].stride' may be used
uninitialized in this function
module_files.f90:35: warning: 'scratch_i4.offset' may be used uninitialized in
this function
[dranta:~/tests/gfortran-D] dir% gfortran --v
Using built-in specs.
Target: powerpc-apple-darwin8.10.0
Configured with: ../gcc/configure --disable-bootstrap --enable-multilib
--prefix=/usr/local/gfortran --enable-languages=c,fortran
Thread model: posix
gcc version 4.3.0 20070921 (experimental) (GCC)


-- 
           Summary: Incorrect warning messages about uninitialized variables
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dir at lanl dot gov
  GCC host triplet: powerpc-apple-darwin8.10.0


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


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

* [Bug fortran/33522] Incorrect warning messages about uninitialized variables
  2007-09-21 19:24 [Bug fortran/33522] New: Incorrect warning messages about uninitialized variables dir at lanl dot gov
@ 2007-09-21 19:25 ` dir at lanl dot gov
  2007-09-22 13:57 ` fxcoudert at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dir at lanl dot gov @ 2007-09-21 19:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dir at lanl dot gov  2007-09-21 19:25 -------
Created an attachment (id=14240)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14240&action=view)
The fortran source


-- 


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


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

* [Bug fortran/33522] Incorrect warning messages about uninitialized variables
  2007-09-21 19:24 [Bug fortran/33522] New: Incorrect warning messages about uninitialized variables dir at lanl dot gov
  2007-09-21 19:25 ` [Bug fortran/33522] " dir at lanl dot gov
@ 2007-09-22 13:57 ` fxcoudert at gcc dot gnu dot org
  2007-09-22 15:02 ` fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-22 13:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2007-09-22 13:57 -------
*** Bug 33523 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug fortran/33522] Incorrect warning messages about uninitialized variables
  2007-09-21 19:24 [Bug fortran/33522] New: Incorrect warning messages about uninitialized variables dir at lanl dot gov
  2007-09-21 19:25 ` [Bug fortran/33522] " dir at lanl dot gov
  2007-09-22 13:57 ` fxcoudert at gcc dot gnu dot org
@ 2007-09-22 15:02 ` fxcoudert at gcc dot gnu dot org
  2007-09-22 16:55 ` fxcoudert at gcc dot gnu dot org
  2007-09-22 16:59 ` fxcoudert at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-22 15:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from fxcoudert at gcc dot gnu dot org  2007-09-22 15:02 -------
Patch below fixes it:

Index: trans-types.c
===================================================================
--- trans-types.c       (revision 128661)
+++ trans-types.c       (working copy)
@@ -1088,16 +1088,19 @@ gfc_get_desc_dim_type (void)
   decl = build_decl (FIELD_DECL,
                     get_identifier ("stride"), gfc_array_index_type);
   DECL_CONTEXT (decl) = type;
+  TREE_NO_WARNING (decl) = 1;
   fieldlist = decl;

   decl = build_decl (FIELD_DECL,
                     get_identifier ("lbound"), gfc_array_index_type);
   DECL_CONTEXT (decl) = type;
+  TREE_NO_WARNING (decl) = 1;
   fieldlist = chainon (fieldlist, decl);

   decl = build_decl (FIELD_DECL,
                     get_identifier ("ubound"), gfc_array_index_type);
   DECL_CONTEXT (decl) = type;
+  TREE_NO_WARNING (decl) = 1;
   fieldlist = chainon (fieldlist, decl);

   /* Finish off the type.  */
@@ -1389,12 +1392,14 @@ gfc_get_array_descriptor_base (int dimen
   decl = build_decl (FIELD_DECL, get_identifier ("offset"),
                     gfc_array_index_type);
   DECL_CONTEXT (decl) = fat_type;
+  TREE_NO_WARNING (decl) = 1;
   fieldlist = chainon (fieldlist, decl);

   /* Add the dtype component.  */
   decl = build_decl (FIELD_DECL, get_identifier ("dtype"),
                     gfc_array_index_type);
   DECL_CONTEXT (decl) = fat_type;
+  TREE_NO_WARNING (decl) = 1;
   fieldlist = chainon (fieldlist, decl);

   /* Build the array type for the stride and bound components.  */
@@ -1406,6 +1411,7 @@ gfc_get_array_descriptor_base (int dimen

   decl = build_decl (FIELD_DECL, get_identifier ("dim"), arraytype);
   DECL_CONTEXT (decl) = fat_type;
+  TREE_NO_WARNING (decl) = 1;
   fieldlist = chainon (fieldlist, decl);

   /* Finish off the type.  */


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org
         AssignedTo|unassigned at gcc dot gnu   |fxcoudert at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic, patch
      Known to fail|                            |4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2007-09-22 15:02:06
               date|                            |


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


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

* [Bug fortran/33522] Incorrect warning messages about uninitialized variables
  2007-09-21 19:24 [Bug fortran/33522] New: Incorrect warning messages about uninitialized variables dir at lanl dot gov
                   ` (2 preceding siblings ...)
  2007-09-22 15:02 ` fxcoudert at gcc dot gnu dot org
@ 2007-09-22 16:55 ` fxcoudert at gcc dot gnu dot org
  2007-09-22 16:59 ` fxcoudert at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-22 16:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from fxcoudert at gcc dot gnu dot org  2007-09-22 16:55 -------
Subject: Bug 33522

Author: fxcoudert
Date: Sat Sep 22 16:54:56 2007
New Revision: 128673

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128673
Log:
        PR fortran/33522
        * trans-types.c (gfc_get_desc_dim_type): Mark artificial
        variables with TREE_NO_WARNING.
        (gfc_get_array_descriptor_base): Likewise.

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


-- 


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


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

* [Bug fortran/33522] Incorrect warning messages about uninitialized variables
  2007-09-21 19:24 [Bug fortran/33522] New: Incorrect warning messages about uninitialized variables dir at lanl dot gov
                   ` (3 preceding siblings ...)
  2007-09-22 16:55 ` fxcoudert at gcc dot gnu dot org
@ 2007-09-22 16:59 ` fxcoudert at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-22 16:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from fxcoudert at gcc dot gnu dot org  2007-09-22 16:59 -------
Fixed.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

end of thread, other threads:[~2007-09-22 16:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-21 19:24 [Bug fortran/33522] New: Incorrect warning messages about uninitialized variables dir at lanl dot gov
2007-09-21 19:25 ` [Bug fortran/33522] " dir at lanl dot gov
2007-09-22 13:57 ` fxcoudert at gcc dot gnu dot org
2007-09-22 15:02 ` fxcoudert at gcc dot gnu dot org
2007-09-22 16:55 ` fxcoudert at gcc dot gnu dot org
2007-09-22 16:59 ` 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).