This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/33833] [4.3 Regression] ICE in build2_stat, at tree.c:3110 at -O3, tree-vectorizer
- From: "dorit at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Oct 2007 06:39:08 -0000
- Subject: [Bug tree-optimization/33833] [4.3 Regression] ICE in build2_stat, at tree.c:3110 at -O3, tree-vectorizer
- References: <bug-33833-12387@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from dorit at gcc dot gnu dot org 2007-10-21 06:39 -------
I was able to reproduce this on i386-linux.
Looks like it's related to PLUS_EXPR vs. POINTER_PLUS_EXPR. The folowing patch
fixes this testcase:
Index: tree-vect-analyze.c
===================================================================
*** tree-vect-analyze.c (revision 129521)
--- tree-vect-analyze.c (working copy)
*************** vect_analyze_data_refs (loop_vec_info lo
*** 3249,3255 ****
inner-loop: *(BASE+INIT). (The first location is actually
BASE+INIT+OFFSET, but we add OFFSET separately later. */
tree inner_base = build_fold_indirect_ref
! (fold_build2 (PLUS_EXPR, TREE_TYPE (base),
base, init));
if (vect_print_dump_info (REPORT_DETAILS))
{
--- 3249,3256 ----
inner-loop: *(BASE+INIT). (The first location is actually
BASE+INIT+OFFSET, but we add OFFSET separately later. */
tree inner_base = build_fold_indirect_ref
! (fold_build2 (POINTER_PLUS_EXPR,
! TREE_TYPE (base), base, init));
if (vect_print_dump_info (REPORT_DETAILS))
{
... but breaks some of the current vectorizer testcases:
WARNING: gcc.dg/vect/vect-62.c compilation failed to produce executable
WARNING: gcc.dg/vect/vect-63.c compilation failed to produce executable
WARNING: gcc.dg/vect/vect-64.c compilation failed to produce executable
WARNING: gcc.dg/vect/vect-65.c compilation failed to produce executable
WARNING: gcc.dg/vect/vect-66.c compilation failed to produce executable
WARNING: gcc.dg/vect/vect-67.c compilation failed to produce executable
WARNING: gcc.dg/vect/vect-70.c compilation failed to produce executable
WARNING: gcc.dg/vect/vect-align-2.c compilation failed to produce executable
WARNING: gcc.dg/vect/no-section-anchors-vect-69.c compilation failed to produce
executable
WARNING: gcc.dg/vect/no-scevccp-slp-30.c compilation failed to produce
executable
I looked into one of these failures, and it fails with:
/home/dorit/mainline/gcc/gcc/testsuite/gcc.dg/vect/vect-62.c:10: internal
compiler error: in build2_stat, at tree.c:3115
Looks like it doesn't like the POINTER_PLUS_EXPR in this case because arg1 is
not compatible with sizetype:
Breakpoint 4, useless_type_conversion_p (outer_type=0xb7cbf000,
inner_type=0xb7cc521c)
at ../../gcc/gcc/tree-ssa.c:1074
1074 {
(gdb) p debug_tree(outer_type)
<integer_type 0xb7cbf000 unsigned int public unsigned sizetype SI
size <integer_cst 0xb7cb2658 type <integer_type 0xb7cbf06c bit_size_type>
constant invariant 32>
unit size <integer_cst 0xb7cb2444 type <integer_type 0xb7cbf000 unsigned
int> constant invariant 4>
align 32 symtab -1210758772 alias set -1 canonical type 0xb7cc50d8
precision 32 min <integer_cst 0xb7cb2674 0> max <integer_cst 0xb7cb2c08 -1>>
$8 = void
(gdb) p debug_tree(inner_type)
<integer_type 0xb7cc521c public sizetype SI
size <integer_cst 0xb7cb2658 type <integer_type 0xb7cbf06c bit_size_type>
constant invariant 32>
unit size <integer_cst 0xb7cb2444 type <integer_type 0xb7cbf000 unsigned
int> constant invariant 4>
align 32 symtab 0 alias set -1 canonical type 0xb7cc521c precision 32 min
<integer_cst 0xb7cb2b98 -2147483648> max <integer_cst 0xb7cb2bb4 2147483647>>
$9 = void
I think POINTER_PLUS_EXPR makes sense here - need to check why we have this
mismatch between unsigned and signed sizetypes (and if that's also the problem
in the other testcases).
--
dorit at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-10-21 06:39:08
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33833