public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/41056]  New: Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3
@ 2009-08-13 14:59 dominiq at lps dot ens dot fr
  2009-08-13 15:09 ` [Bug fortran/41056] " dominiq at lps dot ens dot fr
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-08-13 14:59 UTC (permalink / raw)
  To: gcc-bugs

At revision 150716 the polyhedron test linpk.f90 compiled with -fwholefile at
-O3 does not give the right results:

[ibook-dhum] lin/test% gfc -O3 linpk.f90
[ibook-dhum] lin/test% time a.out 
     norm. resid      resid           machep         x(1)          x(n)
  2.50952975D+01  2.78588264D-11  2.22044605D-16  1.00000000D+00 
1.00000000D+00
27.756u 0.194s 0:28.12 99.3%    0+0k 0+0io 25pf+0w
[ibook-dhum] lin/test% gfc -O3 -fwhole-file linpk.f90
[ibook-dhum] lin/test% time a.out
     norm. resid      resid           machep         x(1)          x(n)
             NaN  0.00000000D+00  2.22044605D-16             NaN            
NaN
4.808u 0.071s 0:04.89 99.5%     0+0k 0+0io 0pf+0w
[ibook-dhum] lin/test% gfc -O2 -fwhole-file linpk.f90
[ibook-dhum] lin/test% time a.out
     norm. resid      resid           machep         x(1)          x(n)
  2.50952975D+01  2.78588264D-11  2.22044605D-16  1.00000000D+00 
1.00000000D+00
27.807u 0.232s 0:28.22 99.3%    0+0k 0+0io 0pf+0w
[ibook-dhum] lin/test% gfc -m64 -O3 -fwhole-file linpk.f90
[ibook-dhum] lin/test% time a.out
     norm. resid      resid           machep         x(1)          x(n)
             NaN  0.00000000D+00  2.22044605D-16             NaN            
NaN
5.016u 0.068s 0:05.18 97.8%     0+0k 0+0io 29pf+0w


-- 
           Summary: Wrong code for polyhedron test linpk.f90 compiled with -
                    fwholefile at -O3
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dominiq at lps dot ens dot fr
 GCC build triplet: *-apple-darwin9
  GCC host triplet: *-apple-darwin9
GCC target triplet: *-apple-darwin9


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


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

* [Bug fortran/41056] Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3
  2009-08-13 14:59 [Bug fortran/41056] New: Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3 dominiq at lps dot ens dot fr
@ 2009-08-13 15:09 ` dominiq at lps dot ens dot fr
  2010-02-24 13:40 ` [Bug middle-end/41056] ICE with -finline-limit=600 and -fwhole-file: type mismatch between an SSA_NAME and its symbol rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-08-13 15:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dominiq at lps dot ens dot fr  2009-08-13 15:09 -------
Note that the right code was obtained with the patch in
http://gcc.gnu.org/ml/fortran/2009-07/msg00232.html.

With this patch compiling aermod.f90 gave an ICE:

[ibook-dhum] lin/test% time gfc aermod.f90 -m64 -O3 -finline-limit=600
-fwhole-file
aermod.f90: In function 'anyavg_.clone.17':
aermod.f90:21763:0: error: type mismatch between an SSA_NAME and its symbol
while verifying SSA_NAME hts_1 in statement
hts_1 = (real(kind=4)[0:D.11239] *) &gridht;
aermod.f90:21763:0: error: type mismatch between an SSA_NAME and its symbol
aermod.f90:21763:0: error: in statement
hts_1 = (real(kind=4)[0:D.11239] *) &gridht;
aermod.f90:21763:0: internal compiler error: verify_ssa failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
35.524u 1.639s 0:37.38 99.3%    0+0k 0+18io 40pf+0w


-- 

dominiq at lps dot ens dot fr changed:

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


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


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

* [Bug middle-end/41056] ICE with -finline-limit=600 and -fwhole-file: type mismatch between an SSA_NAME and its symbol
  2009-08-13 14:59 [Bug fortran/41056] New: Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3 dominiq at lps dot ens dot fr
  2009-08-13 15:09 ` [Bug fortran/41056] " dominiq at lps dot ens dot fr
@ 2010-02-24 13:40 ` rguenth at gcc dot gnu dot org
  2010-02-24 14:10 ` dominiq at lps dot ens dot fr
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-02-24 13:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-02-24 13:40 -------
The SSA name has GFC_ARRAY_TYPE_P set on the pointer type while the var decl
has not.

Reducing.


-- 


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


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

* [Bug middle-end/41056] ICE with -finline-limit=600 and -fwhole-file: type mismatch between an SSA_NAME and its symbol
  2009-08-13 14:59 [Bug fortran/41056] New: Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3 dominiq at lps dot ens dot fr
  2009-08-13 15:09 ` [Bug fortran/41056] " dominiq at lps dot ens dot fr
  2010-02-24 13:40 ` [Bug middle-end/41056] ICE with -finline-limit=600 and -fwhole-file: type mismatch between an SSA_NAME and its symbol rguenth at gcc dot gnu dot org
@ 2010-02-24 14:10 ` dominiq at lps dot ens dot fr
  2010-02-24 14:15 ` dominiq at lps dot ens dot fr
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-02-24 14:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dominiq at lps dot ens dot fr  2010-02-24 14:10 -------
Created an attachment (id=19947)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19947&action=view)
Reduced test case for aermod.


-- 


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


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

* [Bug middle-end/41056] ICE with -finline-limit=600 and -fwhole-file: type mismatch between an SSA_NAME and its symbol
  2009-08-13 14:59 [Bug fortran/41056] New: Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3 dominiq at lps dot ens dot fr
                   ` (2 preceding siblings ...)
  2010-02-24 14:10 ` dominiq at lps dot ens dot fr
@ 2010-02-24 14:15 ` dominiq at lps dot ens dot fr
  2010-02-24 14:37 ` [Bug fortran/41056] " rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-02-24 14:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dominiq at lps dot ens dot fr  2010-02-24 14:15 -------
Note that the miscompilation of linpk.f90 of comment #0 is gone since at least
revision 150825.


-- 


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


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

* [Bug fortran/41056] ICE with -finline-limit=600 and -fwhole-file: type mismatch between an SSA_NAME and its symbol
  2009-08-13 14:59 [Bug fortran/41056] New: Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3 dominiq at lps dot ens dot fr
                   ` (3 preceding siblings ...)
  2010-02-24 14:15 ` dominiq at lps dot ens dot fr
@ 2010-02-24 14:37 ` rguenth at gcc dot gnu dot org
  2010-02-24 16:32 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-02-24 14:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2010-02-24 14:37 -------
The error is exposed somewhen during inlining.  I suppose the frontend has
some unmerged types still (maybe possible to workaround in the middle-end,
but for now a Fortran issue).


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
          Component|middle-end                  |fortran
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-02-24 14:37:04
               date|                            |


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


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

* [Bug fortran/41056] ICE with -finline-limit=600 and -fwhole-file: type mismatch between an SSA_NAME and its symbol
  2009-08-13 14:59 [Bug fortran/41056] New: Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3 dominiq at lps dot ens dot fr
                   ` (4 preceding siblings ...)
  2010-02-24 14:37 ` [Bug fortran/41056] " rguenth at gcc dot gnu dot org
@ 2010-02-24 16:32 ` rguenth at gcc dot gnu dot org
  2010-03-06 17:10 ` dominiq at lps dot ens dot fr
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-02-24 16:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2010-02-24 16:31 -------
Created an attachment (id=19950)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19950&action=view)
further reduced testcase

>From auto-reduction of the reduced testcase.  Fails with -O3 -fwhole-file.


-- 


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


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

* [Bug fortran/41056] ICE with -finline-limit=600 and -fwhole-file: type mismatch between an SSA_NAME and its symbol
  2009-08-13 14:59 [Bug fortran/41056] New: Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3 dominiq at lps dot ens dot fr
                   ` (5 preceding siblings ...)
  2010-02-24 16:32 ` rguenth at gcc dot gnu dot org
@ 2010-03-06 17:10 ` dominiq at lps dot ens dot fr
  2010-03-06 19:43 ` burnus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-03-06 17:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dominiq at lps dot ens dot fr  2010-03-06 17:09 -------
With the following patch the test in comment #6 is hopefully valid (it compiles
with '-O2 -fwhole-file', but gives an ICE with '-O3 -fwhole-file'):

--- pr41056.f90 2010-02-24 17:38:27.000000000 +0100
+++ pr41056_db.f90      2010-02-24 17:55:51.000000000 +0100
@@ -1,16 +1,19 @@
-! { dg-do compile }
       MODULE MAIN1
       INTEGER :: INCSET , IXYSET , IEVSET , IHLSET , IFGSET, DBGUNT
+      INTEGER, PARAMETER :: NLVLS = 20
       LOGICAL ISTA , IEND , NEWID , UNSTAB , STABLE , DEBUG
       LOGICAL ::  PVMRM=.FALSE.
       CHARACTER SRCTYP*8 
       ALLOCATABLE :: SRCTYP(:)
+      REAL :: GRIDHT(NLVLS) , GRIDWS(NLVLS), GRIDSV(NLVLS), GRIDSW(NLVLS) ,
GRIDEPS(NLVLS)
       END
       USE MAIN1
+      allocate(SRCTYP(2))
+      ISRC = 1
       IF ( STABLE .OR. (UNSTAB .AND. (HS.GE.ZI)) ) THEN
          IF ( PPF.LT.1.0 ) THEN
             CALL GINTRP(GRIDHT(NDXEFF),GRIDSV(NDXEFF),GRIDHT(NDXEFF+1), &
-     &                               HTEFF,EPSEFF3)
+     &                               HTEFF,EPSEFF3,VALUE)
          ENDIF
       ENDIF
       IF ( SRCTYP(ISRC).EQ.'POINT' ) THEN
@@ -53,3 +56,7 @@
       IF ( STABLE .OR. (UNSTAB .AND. (HS.GE.ZI)) ) THEN
         ENDIF
       END
+      SUBROUTINE GINTRP(HTBELO,VBELOW,HTABOV,VABOVE,REQDHT,VALUE)
+      REAL VALUE , HTBELO , VBELOW , HTABOV , VABOVE , REQDHT
+      END
+

[macbook] f90/bug% gfc -O3 -fwhole-file pr41056_db.f90
pr41056_db.f90: In function 'anyavg_.clone.0':
pr41056_db.f90:47:0: error: type mismatch between an SSA_NAME and its symbol
while verifying SSA_NAME hts_1 in statement
hts_1 = (real(kind=4)[0:D.1596] * restrict) &gridht;
pr41056_db.f90:47:0: error: type mismatch between an SSA_NAME and its symbol
pr41056_db.f90:47:0: error: in statement
hts_1 = (real(kind=4)[0:D.1596] * restrict) &gridht;
pr41056_db.f90:47:0: internal compiler error: verify_ssa failed


-- 


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


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

* [Bug fortran/41056] ICE with -finline-limit=600 and -fwhole-file: type mismatch between an SSA_NAME and its symbol
  2009-08-13 14:59 [Bug fortran/41056] New: Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3 dominiq at lps dot ens dot fr
                   ` (6 preceding siblings ...)
  2010-03-06 17:10 ` dominiq at lps dot ens dot fr
@ 2010-03-06 19:43 ` burnus at gcc dot gnu dot org
  2010-03-06 22:58 ` burnus at gcc dot gnu dot org
  2010-03-26 15:10 ` rguenth at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-03-06 19:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from burnus at gcc dot gnu dot org  2010-03-06 19:42 -------
Created an attachment (id=20037)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20037&action=view)
Another reduced test case; 34 lines, shows no warning with NAG f95 and gfortran

And another test case. Just 34 lines - and shows no warning with NAG f95 nor
with gfortran -std=f95 -Wall -pedantic. It is now small enough to ICE with "-O3
-flto" or with "-O3 -fwhole-file".


-- 


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


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

* [Bug fortran/41056] ICE with -finline-limit=600 and -fwhole-file: type mismatch between an SSA_NAME and its symbol
  2009-08-13 14:59 [Bug fortran/41056] New: Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3 dominiq at lps dot ens dot fr
                   ` (7 preceding siblings ...)
  2010-03-06 19:43 ` burnus at gcc dot gnu dot org
@ 2010-03-06 22:58 ` burnus at gcc dot gnu dot org
  2010-03-26 15:10 ` rguenth at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-03-06 22:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from burnus at gcc dot gnu dot org  2010-03-06 22:58 -------
(In reply to comment #8)
> Created an attachment (id=20037)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20037&action=view) -- reduced test case

/dev/shm/test/domi14.f90:7:0: error: type mismatch between an SSA_NAME and its
symbol
while verifying SSA_NAME hts_1 in statement
hts_1 = (real(kind=4)[0:D.1549] * restrict) &gridws;

(In reply to comment #2)
The SSA name has GFC_ARRAY_TYPE_P set on the pointer type while the var decl
has not.


Some debugging: If one looks at gfc_get_symbol_decl, "hts" and "gridws" have
GFC_ARRAY_TYPE_P == 1  (i.e. TYPE (sym->backend_decl / s->backend_decl)).

In gfc_conv_procedure_call, TYPE (parmse.expr) (created via
gfc_conv_array_parameter) has GFC_ARRAY_TYPE_P == 0; however, manually setting
it to 1 does not seem to help.

The expression looses (in gfc_conv_array_parameter) the GFC_ARRAY_TYPE_P
attribute via the call to gfc_build_addr_expr; while the basetype is 1, the
natural type is 0. But as written above: manually setting it to 1 does not seem
to help.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|*-apple-darwin9             |
   GCC host triplet|*-apple-darwin9             |
 GCC target triplet|*-apple-darwin9             |


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


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

* [Bug fortran/41056] ICE with -finline-limit=600 and -fwhole-file: type mismatch between an SSA_NAME and its symbol
  2009-08-13 14:59 [Bug fortran/41056] New: Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3 dominiq at lps dot ens dot fr
                   ` (8 preceding siblings ...)
  2010-03-06 22:58 ` burnus at gcc dot gnu dot org
@ 2010-03-26 15:10 ` rguenth at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-03-26 15:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2010-03-26 15:10 -------
PR43505 has a smaller testcase and analysis.  The unreduced testcase from this
bug also passes with -fno-ipa-cp.

*** This bug has been marked as a duplicate of 43505 ***


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2010-03-26 15:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-13 14:59 [Bug fortran/41056] New: Wrong code for polyhedron test linpk.f90 compiled with -fwholefile at -O3 dominiq at lps dot ens dot fr
2009-08-13 15:09 ` [Bug fortran/41056] " dominiq at lps dot ens dot fr
2010-02-24 13:40 ` [Bug middle-end/41056] ICE with -finline-limit=600 and -fwhole-file: type mismatch between an SSA_NAME and its symbol rguenth at gcc dot gnu dot org
2010-02-24 14:10 ` dominiq at lps dot ens dot fr
2010-02-24 14:15 ` dominiq at lps dot ens dot fr
2010-02-24 14:37 ` [Bug fortran/41056] " rguenth at gcc dot gnu dot org
2010-02-24 16:32 ` rguenth at gcc dot gnu dot org
2010-03-06 17:10 ` dominiq at lps dot ens dot fr
2010-03-06 19:43 ` burnus at gcc dot gnu dot org
2010-03-06 22:58 ` burnus at gcc dot gnu dot org
2010-03-26 15:10 ` rguenth 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).