User account creation filtered due to spam.

Bug 7278 - g77 "bug"; the executable misbehave
Summary: g77 "bug"; the executable misbehave
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 3.1
: P3 normal
Target Milestone: ---
Assignee: Toon Moene
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2002-07-11 08:36 UTC by moretti
Modified: 2003-09-23 22:14 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
t.tar (1.69 KB, application/octet-stream)
2003-05-21 15:17 UTC, moretti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description moretti 2002-07-11 08:36:01 UTC
b) problem:
the attached file
                                     t.f
when compiled with the options
                                     -O2 -fno-automatic
produces an executable which gives the wrong output
c) additional (may be useful) informations
   c1) the attached file
                                        t1.f
       is the same as t.f plus an additional subroutine which is not
       called. It still produces wrong output but different from case b)

   c2) both t.f and t1.f when compiled with the options:
                                      -O1 -fno-automatic
        or                            -O2
       give correct output

   c3) previous gcc releases don't show the same "problem"

Release:
3.1

Environment:
) output from gcc -v:
Reading specs from
/home/gcc31/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc-3.1/configure --prefix=/home/carlo/gcc31/
--program-suffix=-3.1 --enable-languages=f77,c,c++,objc
Thread model: single
a) output from gcc -v:
Reading specs from
/home/gcc31/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc-3.1/configure --prefix=/home/carlo/gcc31/
--program-suffix=-3.1 --enable-languages=f77,c,c++,objc
Thread model: single
gcc version 3.1
a) output from gcc -v:
Reading specs from
/home/gcc31/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc-3.1/configure --prefix=/home/carlo/gcc31/
--program-suffix=-3.1 --enable-languages=f77,c,c++,objc
Thread model: single
gcc version 3.1
a) output from gcc -v:
Reading specs from
/home/gcc31/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc-3.1/configure --prefix=/home/carlo/gcc31/
--program-suffix=-3.1 --enable-languages=f77,c,c++,objc
Thread model: single
gcc version 3.1

How-To-Repeat:
untar the attached file
you should obtain the file t.f and t1.f mentioned into
the Description.
Issue g77 -O2 -fno-automatic t.f
Run the executable and you obtain the wrong output
Issue g77 -O1 -fno-automatic t.f or g77 -O2 t.f
Run the executable and you obtain the correct output
Comment 1 Toon Moene 2002-07-11 13:46:11 UTC
Responsible-Changed-From-To: unassigned->toon
Responsible-Changed-Why: Fortran Maintainer.
Comment 2 Toon Moene 2002-07-11 13:46:11 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: It's a regression, at least from 2.95.x onwards, possibly
    from 3.0.x onwards - hence marked `high priority'.
Comment 3 Toon Moene 2002-08-22 23:04:39 UTC
From: Toon Moene <toon@moene.indiv.nluug.nl>
To: gcc-gnats@gcc.gnu.org,  gcc-prs@gcc.gnu.org,  toon@gcc.gnu.org, 
 moretti@fe.infn.it
Cc:  
Subject: Re: fortran/7278: g77 "bug"; the executable misbehave
Date: Thu, 22 Aug 2002 23:04:39 +0200

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7278
 
 It's probably x86 related - I can't reproduce the problem on my Titanium 
 PowerBook (a PowerPC based system).
 
 Kind regards,
 Toon Moene.
 
Comment 4 Toon Moene 2002-09-10 01:55:38 UTC
State-Changed-From-To: analyzed->feedback
State-Changed-Why: It is believed that a recent fix by Jan Hubicka to correct
    the compilation of SPECfp's sixtrack might also have
    fixed the problem you are seeing.
    
    Could you try the latest snapshot (20020909) and see if
    that is indeed the case ?
    
    Thanks.
Comment 5 Roger Sayle 2002-09-29 13:36:25 UTC
State-Changed-From-To: feedback->closed
State-Changed-Why: I've confirmed that this PR has been fixed, probably (as Toon
    suggests) by Jan's recent fixes.  I checked that both t.f
    and t1.f did indeed produce different results between -O2
    and -O2 -fno-automatic using g77 v3.1.  Repeating the tests
    with current mainline however produces the same (correct)
    output.