Bug 49698 - Unmanageable compiler error
Summary: Unmanageable compiler error
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-10 17:29 UTC by Fran Martinez Fadrique
Modified: 2011-07-11 16:50 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-07-11 08:56:52


Attachments
The file where the error is generated at line 1495 (6.51 KB, text/x-fortran)
2011-07-10 17:29 UTC, Fran Martinez Fadrique
Details
Base type used in the module generating the error (1.41 KB, text/x-fortran)
2011-07-10 17:30 UTC, Fran Martinez Fadrique
Details
gcc47-pr49698.patch (572 bytes, patch)
2011-07-11 09:36 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fran Martinez Fadrique 2011-07-10 17:29:14 UTC
Created attachment 24732 [details]
The file where the error is generated at line 1495

The submitted code generates the following error that I cannot debug with the provided information.

t_element_pure_vector_ftl.f90: In function ‘ftl_vector_init’:
t_element_pure_vector_ftl.f90:1495:0: error: type mismatch in binary expression
integer(kind=8)

integer(kind=8)

integer(kind=4)

num.25 = num.25 + 1;

t_element_pure_vector_ftl.f90:1495: confused by earlier errors, bailing out


The compiler options are

-g -std=f2003 -fprofile-arcs -ftest-coverage -fbacktrace -fbounds-check -fno-range-check -fconvert=big-endian -Wall

This code compiles and runs properly with intel 11, 12 and g95
Comment 1 Fran Martinez Fadrique 2011-07-10 17:30:21 UTC
Created attachment 24733 [details]
Base type used in the module generating the error
Comment 2 Jakub Jelinek 2011-07-11 08:56:52 UTC
--- gcc/fortran/trans-stmt.c.jj 2011-07-07 13:23:57.000000000 +0200
+++ gcc/fortran/trans-stmt.c 2011-07-11 10:53:34.000000000 +0200
@@ -3323,7 +3323,7 @@ gfc_trans_pointer_assign_need_temp (gfc_
   count = gfc_create_var (gfc_array_index_type, "count");
   gfc_add_modify (block, count, gfc_index_zero_node);
 
-  inner_size = integer_one_node;
+  inner_size = gfc_index_one_node;
   lss = gfc_walk_expr (expr1);
   rss = gfc_walk_expr (expr2);
   if (lss == gfc_ss_terminator)

seems to fix it.  I'll try to reduce the testcase and bootstrap/regtest it.
Comment 3 Jakub Jelinek 2011-07-11 09:36:43 UTC
Created attachment 24736 [details]
gcc47-pr49698.patch

Patch I'm going to bootstrap/regtest.
Comment 4 Jakub Jelinek 2011-07-11 16:42:33 UTC
Author: jakub
Date: Mon Jul 11 16:42:29 2011
New Revision: 176164

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176164
Log:
	PR fortran/49698
	* trans-stmt.c (gfc_trans_pointer_assign_need_temp): Initialize
	inner_size to gfc_index_one_node instead of integer_one_node.

	* gfortran.dg/pr49698.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr49698.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-stmt.c
    trunk/gcc/testsuite/ChangeLog
Comment 5 Jakub Jelinek 2011-07-11 16:43:27 UTC
Author: jakub
Date: Mon Jul 11 16:43:23 2011
New Revision: 176165

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176165
Log:
	PR fortran/49698
	* trans-stmt.c (gfc_trans_pointer_assign_need_temp): Initialize
	inner_size to gfc_index_one_node instead of integer_one_node.

	* gfortran.dg/pr49698.f90: New test.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/pr49698.f90
Modified:
    branches/gcc-4_6-branch/gcc/fortran/ChangeLog
    branches/gcc-4_6-branch/gcc/fortran/trans-stmt.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 6 Jakub Jelinek 2011-07-11 16:50:09 UTC
Fixed.