Bug 46259 - [4.6 Regression] Revision 166102 failed 416.gamess in SPEC CPU 2006
Summary: [4.6 Regression] Revision 166102 failed 416.gamess in SPEC CPU 2006
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-01 14:37 UTC by H.J. Lu
Modified: 2010-11-01 20:04 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-11-01 16:33:38


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2010-11-01 14:37:28 UTC
On Linux/x86-64, revision 166102:

http://gcc.gnu.org/ml/gcc-cvs/2010-10/msg01289.html

failed to build 416.gamess in SPEC CPU 2006

gfortran -c -o efinp.fppized.o -O3 -funroll-loops -ffast-math -ffixed-form efinp.fppized.f
efinp.fppized.f: In function 'rdstfr':
efinp.fppized.f:2392:0: internal compiler error: tree check: expected integer_cst, have string_cst in tree_to_double_int, at tree.h:4020
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
specmake[1]: *** [efinp.fppized.o] Error 1
specmake[1]: *** Waiting for unfinished jobs....
Comment 1 froydnj@codesourcery.com 2010-11-01 14:40:58 UTC
A backtrace and/or a reduced testcase would be helpful.  I don't have a
copy of SPEC 2006.
Comment 2 H.J. Lu 2010-11-01 14:48:00 UTC
#0  internal_error (gmsgid=0x12a2830 "tree check: %s, have %s in %s, at %s:%d")
    at ../../src/gcc/diagnostic.c:825
#1  0x0000000000ccb556 in tree_check_failed (node=0x7ffff1190f78, 
    file=0x1213380 "../../src/gcc/tree.h", line=4020, 
    function=0x1214490 "tree_to_double_int") at ../../src/gcc/tree.c:8580
#2  0x000000000073f092 in tree_to_double_int (cst=0x7ffff1190f78)
    at ../../src/gcc/tree.h:4020
#3  0x000000000076db8b in const_vector_from_tree (exp=0x7ffff03f5880)
    at ../../src/gcc/expr.c:10253
#4  0x000000000076349b in expand_expr_real_1 (exp=0x7ffff03f5880, 
    target=0x7ffff01fc9c0, tmode=V2DImode, modifier=EXPAND_NORMAL, 
    alt_rtl=0x7fffffffd180) at ../../src/gcc/expr.c:8498
#5  0x000000000075d076 in expand_expr_real (exp=0x7ffff03f5880, 
    target=0x7ffff01fc9c0, tmode=V2DImode, modifier=EXPAND_NORMAL, 
    alt_rtl=0x7fffffffd180) at ../../src/gcc/expr.c:7237
#6  0x000000000074e173 in store_expr (exp=0x7ffff03f5880, 
    target=0x7ffff01fc9c0, call_param_p=0, nontemporal=0 '\000')
    at ../../src/gcc/expr.c:4700
#7  0x000000000074c586 in expand_assignment (to=0x7ffff109fcb0, 
    from=0x7ffff03f5880, nontemporal=0 '\000') at ../../src/gcc/expr.c:4473
#8  0x0000000000662d0b in expand_gimple_stmt_1 (stmt=0x7ffff0a642d0)
    at ../../src/gcc/cfgexpand.c:1991
#9  0x0000000000663136 in expand_gimple_stmt (stmt=0x7ffff0a642d0)
---Type <return> to continue, or q <return> to quit---
    at ../../src/gcc/cfgexpand.c:2100
#10 0x0000000000669ef7 in expand_gimple_basic_block (bb=0x7ffff0de7dd0)
    at ../../src/gcc/cfgexpand.c:3552
#11 0x000000000066bd7d in gimple_expand_cfg () at ../../src/gcc/cfgexpand.c:4029
#12 0x000000000094b7bd in execute_one_pass (pass=0x17b6140)
    at ../../src/gcc/passes.c:1560
#13 0x000000000094b9ac in execute_pass_list (pass=0x17b6140)
    at ../../src/gcc/passes.c:1615
#14 0x0000000000ad7087 in tree_rest_of_compilation (fndecl=0x7ffff11a4500)
    at ../../src/gcc/tree-optimize.c:422
#15 0x0000000000d746e1 in cgraph_expand_function (node=0x7ffff1245840)
    at ../../src/gcc/cgraphunit.c:1494
#16 0x0000000000d748a0 in cgraph_expand_all_functions ()
    at ../../src/gcc/cgraphunit.c:1553
#17 0x0000000000d74ec5 in cgraph_optimize () at ../../src/gcc/cgraphunit.c:1809
#18 0x0000000000d7290b in cgraph_finalize_compilation_unit ()
    at ../../src/gcc/cgraphunit.c:1016
#19 0x00000000008e88cb in write_global_declarations ()
    at ../../src/gcc/langhooks.c:310
#20 0x0000000000552606 in gfc_write_global_declarations ()
    at ../../src/gcc/fortran/f95-lang.c:322
#21 0x0000000000a43358 in compile_file () at ../../src/gcc/toplev.c:931
#22 0x0000000000a45800 in do_compile () at ../../src/gcc/toplev.c:2359
---Type <return> to continue, or q <return> to quit---
#23 0x0000000000a4592c in toplev_main (argc=19, argv=0x7fffffffe138)
    at ../../src/gcc/toplev.c:2419
#24 0x00000000005e7790 in main (argc=19, argv=0x7fffffffe138)
    at ../../src/gcc/main.c:36
(gdb)
Comment 3 H.J. Lu 2010-11-01 14:49:15 UTC
(gdb) f 3
#3  0x000000000076db8b in const_vector_from_tree (exp=0x7ffff03f5880)
    at ../../src/gcc/expr.c:10253
10253		RTVEC_ELT (v, i) = immed_double_int_const (tree_to_double_int (elt),
(gdb) call debug_tree (exp)
 <vector_cst 0x7ffff03f5880
    type <vector_type 0x7ffff0f9ec78
        type <array_type 0x7ffff1236b28 type <integer_type 0x7ffff7ec91f8 character(kind=1)>
            string-flag DI
            size <integer_cst 0x7ffff7eb87d0 constant 64>
            unit size <integer_cst 0x7ffff7eb87f8 constant 8>
            align 8 symtab 0 alias set 4 canonical type 0x7ffff1236b28 domain <integer_type 0x7ffff1236a80>
            pointer_to_this <pointer_type 0x7ffff123e540> reference_to_this <reference_type 0x7ffff111fa80>>
        V2DI
        size <integer_cst 0x7ffff7eb8960 constant 128>
        unit size <integer_cst 0x7ffff7eb8988 constant 16>
        align 128 symtab 0 alias set 4 canonical type 0x7ffff0f9ec78 nunits 2
        pointer_to_this <pointer_type 0x7ffff0f9de70>>
    constant
    elt0:  <string_cst 0x7ffff1190f78 type <array_type 0x7ffff1236b28>
        constant "        "> elt1:  <string_cst 0x7ffff1190f78>>
(gdb)
Comment 4 H.J. Lu 2010-11-01 14:50:25 UTC
(gdb) f 3
#3  0x000000000076db8b in const_vector_from_tree (exp=0x7ffff03f5880)
    at ../../src/gcc/expr.c:10253
10253		RTVEC_ELT (v, i) = immed_double_int_const (tree_to_double_int (elt),
(gdb) call debug_tree (exp)
 <vector_cst 0x7ffff03f5880
    type <vector_type 0x7ffff0f9ec78
        type <array_type 0x7ffff1236b28 type <integer_type 0x7ffff7ec91f8 character(kind=1)>
            string-flag DI
            size <integer_cst 0x7ffff7eb87d0 constant 64>
            unit size <integer_cst 0x7ffff7eb87f8 constant 8>
            align 8 symtab 0 alias set 4 canonical type 0x7ffff1236b28 domain <integer_type 0x7ffff1236a80>
            pointer_to_this <pointer_type 0x7ffff123e540> reference_to_this <reference_type 0x7ffff111fa80>>
        V2DI
        size <integer_cst 0x7ffff7eb8960 constant 128>
        unit size <integer_cst 0x7ffff7eb8988 constant 16>
        align 128 symtab 0 alias set 4 canonical type 0x7ffff0f9ec78 nunits 2
        pointer_to_this <pointer_type 0x7ffff0f9de70>>
    constant
    elt0:  <string_cst 0x7ffff1190f78 type <array_type 0x7ffff1236b28>
        constant "        "> elt1:  <string_cst 0x7ffff1190f78>>
(gdb)
Comment 5 froydnj@codesourcery.com 2010-11-01 14:57:32 UTC
If I had to guess, one of these two hunks is probably responsible:

--- trunk/gcc/tree-vect-loop.c	2010/10/31 01:58:12	166101
+++ trunk/gcc/tree-vect-loop.c	2010/10/31 02:20:22	166102
@@ -3021,14 +3017,7 @@
             break;
           }
 
-        for (i = nunits - 1; i >= 0; --i)
-          t = tree_cons (NULL_TREE, init_value, t);
-
-        if (TREE_CONSTANT (init_val))
-          init_def = build_vector (vectype, t);
-        else
-          init_def = build_constructor_from_list (vectype, t);
-
+	init_def = build_vector_from_val (vectype, init_value);
         break;
 
       default:

--- trunk/gcc/tree-vect-stmts.c	2010/10/31 01:58:12	166101
+++ trunk/gcc/tree-vect-stmts.c	2010/10/31 02:20:22	166102
@@ -987,9 +987,7 @@
   loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
   tree vec_inv;
   tree vec_cst;
-  tree t = NULL_TREE;
   tree def;
-  int i;
   enum vect_def_type dt;
   bool is_simple_use;
   tree vector_type;
@@ -1055,13 +1049,7 @@
         if (vect_print_dump_info (REPORT_DETAILS))
           fprintf (vect_dump, "Create vector_inv.");
 
-        for (i = nunits - 1; i >= 0; --i)
-          {
-            t = tree_cons (NULL_TREE, def, t);
-          }
-
-	/* FIXME: use build_constructor directly.  */
-        vec_inv = build_constructor_from_list (vector_type, t);
+        vec_inv = build_vector_from_val (vector_type, def);
         return vect_init_vector (stmt, vec_inv, vector_type, NULL);
       }

Can you try reverting each one individually and see if those fix the
problem?  Thanks.
Comment 6 H.J. Lu 2010-11-01 16:21:11 UTC
(In reply to comment #5)
> If I had to guess, one of these two hunks is probably responsible:
> 
> 
> --- trunk/gcc/tree-vect-stmts.c    2010/10/31 01:58:12    166101
> +++ trunk/gcc/tree-vect-stmts.c    2010/10/31 02:20:22    166102
> @@ -987,9 +987,7 @@
>    loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
>    tree vec_inv;
>    tree vec_cst;
> -  tree t = NULL_TREE;
>    tree def;
> -  int i;
>    enum vect_def_type dt;
>    bool is_simple_use;
>    tree vector_type;
> @@ -1055,13 +1049,7 @@
>          if (vect_print_dump_info (REPORT_DETAILS))
>            fprintf (vect_dump, "Create vector_inv.");
> 
> -        for (i = nunits - 1; i >= 0; --i)
> -          {
> -            t = tree_cons (NULL_TREE, def, t);
> -          }
> -
> -    /* FIXME: use build_constructor directly.  */
> -        vec_inv = build_constructor_from_list (vector_type, t);
> +        vec_inv = build_vector_from_val (vector_type, def);
>          return vect_init_vector (stmt, vec_inv, vector_type, NULL);
>        }
> 

Revert this patch fixes the problem.
Comment 7 H.J. Lu 2010-11-01 16:33:38 UTC
[hjl@gnu-32 delta-fortran]$ cat testcase-min.f
      SUBROUTINE RDSTFR(FRGMNT,IFRAG,PROVEC,FOCKMA,
     *                  MXBF,MXMO,MXMO2,NTMOF)
      PARAMETER (MXPT=100, MXFRG=50, MXFGPT=MXPT*MXFRG)
      CHARACTER*8 WORD,MNAME,PNAME,RNAME
      COMMON /FRGSTD/ CORD(3,MXPT),PCORD(3,MXPT),POLT(9,MXPT),
     *                INLPR(4*MXPT),IKFR(MXPT),IKLR(MXPT),
     *                MNAME(MXPT),PNAME(MXPT),RNAME(MXPT)
      DO 10 I=1,MXPT
         INLPR(4*(I-1)+1)=0
         INLPR(4*(I-1)+2)=0
         INLPR(4*(I-1)+3)=0
         INLPR(4*(I-1)+4)=0
         IKLR(I)=0
         RNAME(I)='        '
   10 CONTINUE
      END
[hjl@gnu-32 delta-fortran]$ /export/gnu/import/rrs/166102/usr/bin/gcc -S -O3 -ffast-math -funroll-loops -ffixed-form -S testcase-min.f
testcase-min.f: In function ‘rdstfr’:
testcase-min.f:14:0: internal compiler error: tree check: expected integer_cst, have string_cst in tree_to_double_int, at tree.h:4020
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[hjl@gnu-32 delta-fortran]$
Comment 8 Nathan Froyd 2010-11-01 18:58:35 UTC
Author: froydnj
Date: Mon Nov  1 18:58:30 2010
New Revision: 166139

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166139
Log:
gcc/
2010-11-01  Nathan Froyd  <froydnj@codesourcery.com>

	PR tree-optimization/46259

	Revert:

	2010-10-30  Nathan Froyd  <froydnj@codesourcery.com>

	* tree-vect-stmts.c (vect_get_vec_def_for_operand): Use
	build_vector_from_val.

gcc/testsuite/
2010-11-01  H.J. Lu  <hongjiu.lu@intel.com>
	    Nathan Froyd  <froydnj@codesourcery.com>

	PR tree-optimization/46259
	* gfortran.dg/pr46259.f: New testcase.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr46259.f
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-stmts.c
Comment 9 Jakub Jelinek 2010-11-01 20:04:25 UTC
Fixed.