From ca4882a2acf9d7c0694676f462bf7f215e7352c0 Mon Sep 17 00:00:00 2001 From: rakdver Date: Sun, 3 Jun 2007 19:21:12 +0000 Subject: [PATCH] PR tree-optimization/32194 * tree-predcom.c (determine_offset): Check that both references have the same type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125298 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/tree-predcom.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2214ddf712a..39dd070c8d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2007-06-03 Zdenek Dvorak + PR tree-optimization/32194 + * tree-predcom.c (determine_offset): Check that both references have + the same type. + +2007-06-03 Zdenek Dvorak + * cfgloopmanip.c (remove_path, loopify, duplicate_loop_to_header_edge): Change dom_bbs to vector. Add argument to iterate_fix_dominators call. * loop-unroll.c (unroll_loop_runtime_iterations): Ditto. diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c index b5c82923ee2..15fcafe76e1 100644 --- a/gcc/tree-predcom.c +++ b/gcc/tree-predcom.c @@ -628,6 +628,13 @@ determine_offset (struct data_reference *a, struct data_reference *b, double_int *off) { aff_tree diff, baseb, step; + tree typea, typeb; + + /* Check that both the references access the location in the same type. */ + typea = TREE_TYPE (DR_REF (a)); + typeb = TREE_TYPE (DR_REF (b)); + if (!tree_ssa_useless_type_conversion_1 (typeb, typea)) + return false; /* Check whether the base address and the step of both references is the same. */ -- 2.11.0