public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/34907]  New: valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec
@ 2008-01-21 22:03 ismail at pardus dot org dot tr
  2008-01-21 22:06 ` [Bug middle-end/34907] " ismail at pardus dot org dot tr
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ismail at pardus dot org dot tr @ 2008-01-21 22:03 UTC (permalink / raw)
  To: gcc-bugs

Valgrind shows,

FAIL: gfortran.dg/char_cshift_1.f90  -O0  (test for excess errors)
Excess errors:
==28334== Conditional jump or move depends on uninitialised value(s)
==28334==    at 0x811A4B9: gfc_typenode_for_spec (trans-types.c:848)
==28334==    by 0x810041F: gfc_conv_intrinsic_conversion
(trans-intrinsic.c:265)
==28334==    by 0x8108A81: gfc_conv_intrinsic_function (trans-intrinsic.c:3822)
==28334==    by 0x80FCE9D: gfc_conv_function_expr (trans-expr.c:3033)
==28334==    by 0x80FE23B: gfc_conv_expr (trans-expr.c:3537)
==28334==    by 0x80FE5E3: gfc_conv_expr_reference (trans-expr.c:3660)
==28334==    by 0x80FB74B: gfc_conv_function_call (trans-expr.c:2428)
==28334==    by 0x810370F: gfc_conv_intrinsic_funcall (trans-intrinsic.c:1641)
==28334==    by 0x8108811: gfc_conv_intrinsic_function (trans-intrinsic.c:3727)
==28334==    by 0x80FCE9D: gfc_conv_function_expr (trans-expr.c:3033)
==28334==    by 0x80FE23B: gfc_conv_expr (trans-expr.c:3537)
==28334==    by 0x80E42C9: gfc_add_loop_ss_code (trans-array.c:1902)


-- 
           Summary: valgrind error indication from testsuite trans-types.c:
                    gfc_typenode_for_spec
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ismail at pardus dot org dot tr
  GCC host triplet: i686-linux-gnu


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


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

* [Bug middle-end/34907] valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec
  2008-01-21 22:03 [Bug middle-end/34907] New: valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec ismail at pardus dot org dot tr
@ 2008-01-21 22:06 ` ismail at pardus dot org dot tr
  2008-01-21 22:07 ` ismail at pardus dot org dot tr
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ismail at pardus dot org dot tr @ 2008-01-21 22:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ismail at pardus dot org dot tr  2008-01-21 21:59 -------
Used svn revision 131650.


-- 


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


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

* [Bug middle-end/34907] valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec
  2008-01-21 22:03 [Bug middle-end/34907] New: valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec ismail at pardus dot org dot tr
  2008-01-21 22:06 ` [Bug middle-end/34907] " ismail at pardus dot org dot tr
@ 2008-01-21 22:07 ` ismail at pardus dot org dot tr
  2008-01-21 23:20 ` [Bug fortran/34907] " burnus at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ismail at pardus dot org dot tr @ 2008-01-21 22:07 UTC (permalink / raw)
  To: gcc-bugs

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



------- Comment #2 from ismail at pardus dot org dot tr  2008-01-21 22:00 -------
Also this part seems to apply too: 

==29085==·
==29085== Conditional jump or move depends on uninitialised value(s)
==29085==    at 0x811A4B9: gfc_typenode_for_spec (trans-types.c:848)
==29085==    by 0x810041F: gfc_conv_intrinsic_conversion
(trans-intrinsic.c:265)
==29085==    by 0x8108A81: gfc_conv_intrinsic_function (trans-intrinsic.c:3822)
==29085==    by 0x80FCE9D: gfc_conv_function_expr (trans-expr.c:3033)
==29085==    by 0x80FE23B: gfc_conv_expr (trans-expr.c:3537)
==29085==    by 0x80FE365: gfc_conv_expr_val (trans-expr.c:3590)
==29085==    by 0x80EA952: gfc_conv_expr_descriptor (trans-array.c:4805)
==29085==    by 0x80EB554: gfc_conv_array_parameter (trans-array.c:5102)
==29085==    by 0x80FB8C1: gfc_conv_function_call (trans-expr.c:2464)
==29085==    by 0x810370F: gfc_conv_intrinsic_funcall (trans-intrinsic.c:1641)
==29085==    by 0x8108811: gfc_conv_intrinsic_function (trans-intrinsic.c:3727)
==29085==    by 0x80FCE9D: gfc_conv_function_expr (trans-expr.c:3033)


-- 


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


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

* [Bug fortran/34907] valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec
  2008-01-21 22:03 [Bug middle-end/34907] New: valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec ismail at pardus dot org dot tr
  2008-01-21 22:06 ` [Bug middle-end/34907] " ismail at pardus dot org dot tr
  2008-01-21 22:07 ` ismail at pardus dot org dot tr
@ 2008-01-21 23:20 ` burnus at gcc dot gnu dot org
  2008-01-21 23:34 ` burnus at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-21 23:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2008-01-21 23:11 -------
Move to Fortran. The problem seems to be:

      if (spec->f90_type == BT_VOID)

which is for some reason not initialized. With openSUSE's 4.3.0 20080102 I
don't see it.

I actually do not see how this comes as  gfc_clear_ts sets it.

In any case the following is a useful patch:

Index: parse.c
===================================================================
--- parse.c     (Revision 131702)
+++ parse.c
@@ -2189,7 +2189,7 @@ loop:

       gfc_current_block ()->ts.kind = 0;
       /* Keep the derived type; if it's bad, it will be discovered later.  */
-      if (!(ts->type = BT_DERIVED && ts->derived))
+      if (!(ts->type == BT_DERIVED && ts->derived))
         ts->type = BT_UNKNOWN;
     }


-- 

burnus at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/34907] valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec
  2008-01-21 22:03 [Bug middle-end/34907] New: valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec ismail at pardus dot org dot tr
                   ` (2 preceding siblings ...)
  2008-01-21 23:20 ` [Bug fortran/34907] " burnus at gcc dot gnu dot org
@ 2008-01-21 23:34 ` burnus at gcc dot gnu dot org
  2008-01-22  4:12 ` jvdelisle at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-21 23:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2008-01-21 23:26 -------
I wonder whether the following makes sense; I think it does, but it does not
seem to fix the problem :-(

Index: decl.c
===================================================================
--- decl.c      (Revision 131702)
+++ decl.c      (Arbeitskopie)
@@ -1593,6 +1593,7 @@ variable_decl (int elem)
          sym->ts.derived = current_ts.derived;
          sym->ts.is_c_interop = current_ts.is_c_interop;
          sym->ts.is_iso_c = current_ts.is_iso_c;
+         sym->ts.f90_type = current_ts.f90_type;
          m = MATCH_YES;

          /* Check to see if we have an array specification.  */


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-21 23:26:50
               date|                            |


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


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

* [Bug fortran/34907] valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec
  2008-01-21 22:03 [Bug middle-end/34907] New: valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec ismail at pardus dot org dot tr
                   ` (3 preceding siblings ...)
  2008-01-21 23:34 ` burnus at gcc dot gnu dot org
@ 2008-01-22  4:12 ` jvdelisle at gcc dot gnu dot org
  2008-01-22 17:10 ` burnus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-01-22  4:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2008-01-22 03:30 -------
I would commit the parse.c line in comment #3 as OBVIOUS and get that out of
the way.  

This looks like a pointer casting problem similar to recent patches I made for
the cshift optional dummy problems. (sigh)  I will look around a bit.


-- 


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


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

* [Bug fortran/34907] valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec
  2008-01-21 22:03 [Bug middle-end/34907] New: valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec ismail at pardus dot org dot tr
                   ` (4 preceding siblings ...)
  2008-01-22  4:12 ` jvdelisle at gcc dot gnu dot org
@ 2008-01-22 17:10 ` burnus at gcc dot gnu dot org
  2008-02-16 16:47 ` jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-22 17:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from burnus at gcc dot gnu dot org  2008-01-22 16:44 -------
Subject: Bug 34907

Author: burnus
Date: Tue Jan 22 16:43:20 2008
New Revision: 131728

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131728
Log:
2008-01-22  Tobias Burnus  <burnus@net-b.de>

       PR fortran/34907
       * parse.c (parse_spec): Change = into ==.


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


-- 


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


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

* [Bug fortran/34907] valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec
  2008-01-21 22:03 [Bug middle-end/34907] New: valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec ismail at pardus dot org dot tr
                   ` (5 preceding siblings ...)
  2008-01-22 17:10 ` burnus at gcc dot gnu dot org
@ 2008-02-16 16:47 ` jvdelisle at gcc dot gnu dot org
  2008-02-16 18:23 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-02-16 16:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jvdelisle at gcc dot gnu dot org  2008-02-16 16:46 -------
There are a dozen or two places where we create local temporaries of type
gfc_typespec but we do not call gfc_clear_ts before using it.  This leaves
things potentially uninitialized depending on how it is used.

We should probably just go through and initialize them all for good measure.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-01-21 23:26:50         |2008-02-16 16:46:19
               date|                            |


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


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

* [Bug fortran/34907] valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec
  2008-01-21 22:03 [Bug middle-end/34907] New: valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec ismail at pardus dot org dot tr
                   ` (6 preceding siblings ...)
  2008-02-16 16:47 ` jvdelisle at gcc dot gnu dot org
@ 2008-02-16 18:23 ` jvdelisle at gcc dot gnu dot org
  2008-02-22  6:23 ` jvdelisle at gcc dot gnu dot org
  2008-02-27  4:39 ` jvdelisle at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-02-16 18:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jvdelisle at gcc dot gnu dot org  2008-02-16 18:22 -------
Here is the culprit:

Index: iresolve.c
===================================================================
--- iresolve.c  (revision 132355)
+++ iresolve.c  (working copy)
@@ -585,6 +585,7 @@ gfc_resolve_cshift (gfc_expr *f, gfc_exp
   if (shift->ts.kind < m)
     {
       gfc_typespec ts;
+      gfc_clear_ts (&ts);
       ts.type = BT_INTEGER;
       ts.kind = m;
       gfc_convert_type_warn (shift, &ts, 2, 0);

This fixes it.  There are a bunch of these in iresolve.c  I will fix them all
for 4.4


-- 


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


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

* [Bug fortran/34907] valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec
  2008-01-21 22:03 [Bug middle-end/34907] New: valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec ismail at pardus dot org dot tr
                   ` (7 preceding siblings ...)
  2008-02-16 18:23 ` jvdelisle at gcc dot gnu dot org
@ 2008-02-22  6:23 ` jvdelisle at gcc dot gnu dot org
  2008-02-27  4:39 ` jvdelisle at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-02-22  6:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jvdelisle at gcc dot gnu dot org  2008-02-22 06:22 -------
Subject: Bug 34907

Author: jvdelisle
Date: Fri Feb 22 06:21:47 2008
New Revision: 132541

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132541
Log:
2008-02-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR fortran/34907
        * iresolve.c (resolve_mask_arg): Add gfc_clear_ts to initialize
        structure.
        (gfc_resolve_aint): Likewise.
        (gfc_resolve_anint): Likewise.
        (gfc_resolve_besn): Likewise.
        (gfc_resolve_cshift): Likewise.
        (gfc_resolve_ctime): Likewise.
        (gfc_resolve_eoshift): Likewise.
        (gfc_resolve_index_func): Likewise.
        (gfc_resolve_isatty): Likewise.
        (gfc_resolve_malloc): Likewise.
        (gfc_resolve_rrspacing): Likewise.
        (gfc_resolve_scale): Likewise.
        (gfc_resolve_set_exponent): Likewise.
        (gfc_resolve_spacing): Likewise.
        (gfc_resolve_spacing): Likewise.
        (gfc_resolve_fgetc): Likewise.
        (gfc_resolve_fputc): Likewise.
        (gfc_resolve_ftell): Likewise.
        (gfc_resolve_ttynam): Likewise.
        (gfc_resolve_alarm_sub): Likewise.
        (gfc_resolve_mvbits): Likewise.
        (gfc_resolve_getarg): Likewise.
        (gfc_resolve_signal_sub): Likewise.
        (gfc_resolve_exit): Likewise.
        (gfc_resolve_flush): Likewise.
        (gfc_resolve_free): Likewise.
        (gfc_resolve_ctime_sub): Likewise.
        (gfc_resolve_fgetc_sub): Likewise.
        (gfc_resolve_fputc_sub): Likewise.
        (gfc_resolve_fseek_sub): Likewise.
        (gfc_resolve_ftell_sub): Likewise.
        (gfc_resolve_ttynam_sub): Likewise.

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


-- 


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


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

* [Bug fortran/34907] valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec
  2008-01-21 22:03 [Bug middle-end/34907] New: valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec ismail at pardus dot org dot tr
                   ` (8 preceding siblings ...)
  2008-02-22  6:23 ` jvdelisle at gcc dot gnu dot org
@ 2008-02-27  4:39 ` jvdelisle at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-02-27  4:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jvdelisle at gcc dot gnu dot org  2008-02-27 04:38 -------
Fixed on trunk.


-- 

jvdelisle at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-02-27  4:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-21 22:03 [Bug middle-end/34907] New: valgrind error indication from testsuite trans-types.c: gfc_typenode_for_spec ismail at pardus dot org dot tr
2008-01-21 22:06 ` [Bug middle-end/34907] " ismail at pardus dot org dot tr
2008-01-21 22:07 ` ismail at pardus dot org dot tr
2008-01-21 23:20 ` [Bug fortran/34907] " burnus at gcc dot gnu dot org
2008-01-21 23:34 ` burnus at gcc dot gnu dot org
2008-01-22  4:12 ` jvdelisle at gcc dot gnu dot org
2008-01-22 17:10 ` burnus at gcc dot gnu dot org
2008-02-16 16:47 ` jvdelisle at gcc dot gnu dot org
2008-02-16 18:23 ` jvdelisle at gcc dot gnu dot org
2008-02-22  6:23 ` jvdelisle at gcc dot gnu dot org
2008-02-27  4:39 ` jvdelisle 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).