public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/36316]  New: type mismatch in binary expression caught by verify_gimple
@ 2008-05-23 18:23 toon at moene dot indiv dot nluug dot nl
  2008-05-23 18:36 ` [Bug fortran/36316] " dominiq at lps dot ens dot fr
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: toon at moene dot indiv dot nluug dot nl @ 2008-05-23 18:23 UTC (permalink / raw)
  To: gcc-bugs

The following module definition:

MODULE YOMCAIN

IMPLICIT NONE
SAVE

TYPE distributed_vector
REAL, pointer :: local(:)
INTEGER       :: global_length,local_start,local_end,nchnks
END TYPE distributed_vector

INTERFACE ASSIGNMENT (=)
MODULE PROCEDURE assign_dv_dv
END INTERFACE

INTERFACE OPERATOR (*)
MODULE PROCEDURE multiply_dv_dv
END INTERFACE

CONTAINS

SUBROUTINE assign_dv_dv (handle1,handle2)

!         copy one distributed_vector to another

TYPE (distributed_vector), INTENT(IN)    :: handle2
TYPE (distributed_vector), INTENT(INOUT) :: handle1

handle1%local(:) = handle2%local(:)

RETURN
END SUBROUTINE assign_dv_dv

FUNCTION multiply_dv_dv (handle1,handle2)

!         multiply two distributed_vectors

TYPE (distributed_vector), INTENT(IN) :: handle2
TYPE (distributed_vector), INTENT(IN) :: handle1
REAL, DIMENSION(handle1%local_start:handle1%local_end) ::multiply_dv_dv

multiply_dv_dv = handle1%local(:) * handle2%local(:)

RETURN
END FUNCTION multiply_dv_dv


SUBROUTINE CAININAD_SCALE_DISTVEC ()
TYPE (distributed_vector) :: PVAZG
TYPE (distributed_vector) :: ZTEMP
TYPE (distributed_vector) :: SCALP_DV

ZTEMP = PVAZG * SCALP_DV
END SUBROUTINE CAININAD_SCALE_DISTVEC
END MODULE YOMCAIN

draws this error message when compiling with a recent 4.4.0 gfortran:

a.F90: In function 'caininad_scale_distvec':
a.F90:47: error: type mismatch in binary expression
integer(kind=8)

integer(kind=4)

integer(kind=4)

D.1027 = D.1026 - D.1025
a.F90:47: internal compiler error: verify_gimple failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

This 4.3.1 gfortran doesn't have any complaints about this source:

gfortran -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure linux gnu
Thread model: posix
gcc version 4.3.1 20080401 (prerelease) (Debian 4.3.0-3)


-- 
           Summary: type mismatch in binary expression caught by
                    verify_gimple
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: toon at moene dot indiv dot nluug dot nl


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


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

* [Bug fortran/36316] type mismatch in binary expression caught by verify_gimple
  2008-05-23 18:23 [Bug fortran/36316] New: type mismatch in binary expression caught by verify_gimple toon at moene dot indiv dot nluug dot nl
@ 2008-05-23 18:36 ` dominiq at lps dot ens dot fr
  2008-05-23 19:57 ` burnus at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens dot fr @ 2008-05-23 18:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dominiq at lps dot ens dot fr  2008-05-23 18:35 -------
On *-apple-darwin9, revision 135821, but also gfortran 4.3.0, I get:

pr36316.f90:52.5:

ZTEMP = PVAZG * SCALP_DV
    1
Error: Incompatible ranks 0 and 1 in assignment at (1)

Same thing with ifort 10.1 and g95.


-- 


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


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

* [Bug fortran/36316] type mismatch in binary expression caught by verify_gimple
  2008-05-23 18:23 [Bug fortran/36316] New: type mismatch in binary expression caught by verify_gimple toon at moene dot indiv dot nluug dot nl
  2008-05-23 18:36 ` [Bug fortran/36316] " dominiq at lps dot ens dot fr
@ 2008-05-23 19:57 ` burnus at gcc dot gnu dot org
  2008-05-23 20:08 ` toon at moene dot indiv dot nluug dot nl
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-05-23 19:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2008-05-23 19:56 -------
Same here. With gfortran 4.1, 4.2 and 4.3 of openSUSE and with today's builds
of 4.2, 4.3 and 4.4 I get the error message. Also valgrind does not show any
problems.


-- 


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


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

* [Bug fortran/36316] type mismatch in binary expression caught by verify_gimple
  2008-05-23 18:23 [Bug fortran/36316] New: type mismatch in binary expression caught by verify_gimple toon at moene dot indiv dot nluug dot nl
  2008-05-23 18:36 ` [Bug fortran/36316] " dominiq at lps dot ens dot fr
  2008-05-23 19:57 ` burnus at gcc dot gnu dot org
@ 2008-05-23 20:08 ` toon at moene dot indiv dot nluug dot nl
  2008-05-24 11:02 ` burnus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: toon at moene dot indiv dot nluug dot nl @ 2008-05-23 20:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from toon at moene dot indiv dot nluug dot nl  2008-05-23 20:07 -------
Ugh, sorry, I see I included the wrong source.

Here's the correct one:

MODULE YOMCAIN

IMPLICIT NONE
SAVE

TYPE distributed_vector
REAL, pointer :: local(:)
INTEGER       :: global_length,local_start,local_end,nchnks
END TYPE distributed_vector

INTERFACE ASSIGNMENT (=)
MODULE PROCEDURE assign_ar_dv
END INTERFACE

INTERFACE OPERATOR (*)
MODULE PROCEDURE multiply_dv_dv
END INTERFACE

CONTAINS

SUBROUTINE assign_ar_dv (handle,pvec)

!         copy array to the distributed_vector

REAL,                      INTENT(IN)    :: pvec(:)
TYPE (distributed_vector), INTENT(INOUT) :: handle

handle%local(:) = pvec(:)

RETURN
END SUBROUTINE assign_ar_dv

FUNCTION multiply_dv_dv (handle1,handle2)

!         multiply two distributed_vectors

TYPE (distributed_vector), INTENT(IN) :: handle2
TYPE (distributed_vector), INTENT(IN) :: handle1
REAL, DIMENSION(handle1%local_start:handle1%local_end) ::multiply_dv_dv

multiply_dv_dv = handle1%local(:) * handle2%local(:)

RETURN
END FUNCTION multiply_dv_dv


SUBROUTINE CAININAD_SCALE_DISTVEC ()
TYPE (distributed_vector) :: PVAZG
TYPE (distributed_vector) :: ZTEMP
TYPE (distributed_vector) :: SCALP_DV

ZTEMP = PVAZG * SCALP_DV
END SUBROUTINE CAININAD_SCALE_DISTVEC
END MODULE YOMCAIN

Apologies ...


-- 


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


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

* [Bug fortran/36316] type mismatch in binary expression caught by verify_gimple
  2008-05-23 18:23 [Bug fortran/36316] New: type mismatch in binary expression caught by verify_gimple toon at moene dot indiv dot nluug dot nl
                   ` (2 preceding siblings ...)
  2008-05-23 20:08 ` toon at moene dot indiv dot nluug dot nl
@ 2008-05-24 11:02 ` burnus at gcc dot gnu dot org
  2008-05-25 22:00 ` burnus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-05-24 11:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2008-05-24 11:02 -------
CONFIRM. Due to the missing checking it works with openSUSE's 4.1, 4.2, 4.3;
however, if one studies the source code, it is also wrong in other 4.x besides
4.4. The current test case fails only on systems where c_intptr_t == 8, but it
can easily be modified to show the same problem on c_intptr_t == 4 systems by
changing in

  INTEGER       :: global_length,local_start,local_end,nchnks
END TYPE distributed_vector

INTEGER into INTEGER(8) (which in turn fixes the program in -m64 systems).


The original dump shows the problem:

caininad_scale_distvec ()
    integer(kind=8) D.1027;
    integer(kind=4) D.1026;
    integer(kind=4) D.1025;
    D.1023 = &pvazg;
    D.1025 = D.1023->local_start;
    D.1026 = D.1023->local_end;
    D.1027 = D.1026 - D.1025;  // which is integer(8) = integer(4) - integer(4)


D.1023->local_start; and D.1023->local_end; are used in:

  REAL, DIMENSION(handle1%local_start:handle1%local_end) ::multiply_dv_dv


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2008-05-24 11:02:06
               date|                            |


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


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

* [Bug fortran/36316] type mismatch in binary expression caught by verify_gimple
  2008-05-23 18:23 [Bug fortran/36316] New: type mismatch in binary expression caught by verify_gimple toon at moene dot indiv dot nluug dot nl
                   ` (3 preceding siblings ...)
  2008-05-24 11:02 ` burnus at gcc dot gnu dot org
@ 2008-05-25 22:00 ` burnus at gcc dot gnu dot org
  2008-05-26 15:49 ` fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-05-25 22:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from burnus at gcc dot gnu dot org  2008-05-25 22:00 -------
Somewhere a 
  fold_convert (TREE_TYPE (to_tree), from_tree)
is missing, but I fail to see where. I think one could add a couple of those in
trans-array.c; I think there is more than one missing.


-- 


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


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

* [Bug fortran/36316] type mismatch in binary expression caught by verify_gimple
  2008-05-23 18:23 [Bug fortran/36316] New: type mismatch in binary expression caught by verify_gimple toon at moene dot indiv dot nluug dot nl
                   ` (4 preceding siblings ...)
  2008-05-25 22:00 ` burnus at gcc dot gnu dot org
@ 2008-05-26 15:49 ` fxcoudert at gcc dot gnu dot org
  2008-05-27 19:23 ` burnus at gcc dot gnu dot org
  2008-05-27 19:23 ` burnus at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-05-26 15:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from fxcoudert at gcc dot gnu dot org  2008-05-26 15:48 -------
(In reply to comment #5)
> Somewhere a 
>   fold_convert (TREE_TYPE (to_tree), from_tree)
> is missing, but I fail to see where. I think one could add a couple of those in
> trans-array.c; I think there is more than one missing.

An easy thing to do is to set a breakpoint in gfc_create_var or whatever
routine creates these temporary variables, and hit 'c' under gdb until you have
the correct D.number; then, the backtrace will tell you where it's created (and
it's usually assigned to close to that).


-- 

fxcoudert at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/36316] type mismatch in binary expression caught by verify_gimple
  2008-05-23 18:23 [Bug fortran/36316] New: type mismatch in binary expression caught by verify_gimple toon at moene dot indiv dot nluug dot nl
                   ` (6 preceding siblings ...)
  2008-05-27 19:23 ` burnus at gcc dot gnu dot org
@ 2008-05-27 19:23 ` burnus at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-05-27 19:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from burnus at gcc dot gnu dot org  2008-05-27 19:22 -------
Found it - took only 4 hours.
FIXED on the trunk (4.4.0). Thanks for reporting the bug.


-- 

burnus at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/36316] type mismatch in binary expression caught by verify_gimple
  2008-05-23 18:23 [Bug fortran/36316] New: type mismatch in binary expression caught by verify_gimple toon at moene dot indiv dot nluug dot nl
                   ` (5 preceding siblings ...)
  2008-05-26 15:49 ` fxcoudert at gcc dot gnu dot org
@ 2008-05-27 19:23 ` burnus at gcc dot gnu dot org
  2008-05-27 19:23 ` burnus at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-05-27 19:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from burnus at gcc dot gnu dot org  2008-05-27 19:22 -------
Subject: Bug 36316

Author: burnus
Date: Tue May 27 19:22:01 2008
New Revision: 136052

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

        PR fortran/36316
        * trans-array.c (gfc_set_loop_bounds_from_array_spec):
        Add missing fold_convert.

2008-05-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/36316
        * gfortran.dg/assignment_3.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/assignment_3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

end of thread, other threads:[~2008-05-27 19:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-23 18:23 [Bug fortran/36316] New: type mismatch in binary expression caught by verify_gimple toon at moene dot indiv dot nluug dot nl
2008-05-23 18:36 ` [Bug fortran/36316] " dominiq at lps dot ens dot fr
2008-05-23 19:57 ` burnus at gcc dot gnu dot org
2008-05-23 20:08 ` toon at moene dot indiv dot nluug dot nl
2008-05-24 11:02 ` burnus at gcc dot gnu dot org
2008-05-25 22:00 ` burnus at gcc dot gnu dot org
2008-05-26 15:49 ` fxcoudert at gcc dot gnu dot org
2008-05-27 19:23 ` burnus at gcc dot gnu dot org
2008-05-27 19:23 ` burnus 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).