diff options
author | Richard Biener <rguenther@suse.de> | 2018-10-25 08:59:07 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-10-25 08:59:07 +0000 |
commit | 7852940e7bbeae3c40cdc6c61356099216bde688 (patch) | |
tree | d0269475b4bf8ab3314d8e3d43d8c563b1a6ecab /gcc/tree-vectorizer.h | |
parent | 86f36311bccb0fed7de68aa926d6a091bcb5114c (diff) | |
download | gcc-7852940e7bbeae3c40cdc6c61356099216bde688.zip gcc-7852940e7bbeae3c40cdc6c61356099216bde688.tar.gz gcc-7852940e7bbeae3c40cdc6c61356099216bde688.tar.bz2 |
re PR tree-optimization/87665 (gcc HEAD (svn: 265340) breaks elements on resize)
2018-10-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/87665
PR tree-optimization/87745
* tree-vectorizer.h (get_earlier_stmt): Remove.
(get_later_stmt): Pick up UID from the original non-pattern stmt.
* gfortran.dg/20181025-1.f: New testcase.
From-SVN: r265481
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 9884568..08d696a 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1085,38 +1085,6 @@ nested_in_vect_loop_p (struct loop *loop, stmt_vec_info stmt_info) && (loop->inner == (gimple_bb (stmt_info->stmt))->loop_father)); } -/* Return the earlier statement between STMT1_INFO and STMT2_INFO. */ - -static inline stmt_vec_info -get_earlier_stmt (stmt_vec_info stmt1_info, stmt_vec_info stmt2_info) -{ - gcc_checking_assert ((STMT_VINFO_IN_PATTERN_P (stmt1_info) - || !STMT_VINFO_RELATED_STMT (stmt1_info)) - && (STMT_VINFO_IN_PATTERN_P (stmt2_info) - || !STMT_VINFO_RELATED_STMT (stmt2_info))); - - if (gimple_uid (stmt1_info->stmt) < gimple_uid (stmt2_info->stmt)) - return stmt1_info; - else - return stmt2_info; -} - -/* Return the later statement between STMT1_INFO and STMT2_INFO. */ - -static inline stmt_vec_info -get_later_stmt (stmt_vec_info stmt1_info, stmt_vec_info stmt2_info) -{ - gcc_checking_assert ((STMT_VINFO_IN_PATTERN_P (stmt1_info) - || !STMT_VINFO_RELATED_STMT (stmt1_info)) - && (STMT_VINFO_IN_PATTERN_P (stmt2_info) - || !STMT_VINFO_RELATED_STMT (stmt2_info))); - - if (gimple_uid (stmt1_info->stmt) > gimple_uid (stmt2_info->stmt)) - return stmt1_info; - else - return stmt2_info; -} - /* Return TRUE if a statement represented by STMT_INFO is a part of a pattern. */ @@ -1137,6 +1105,18 @@ vect_orig_stmt (stmt_vec_info stmt_info) return stmt_info; } +/* Return the later statement between STMT1_INFO and STMT2_INFO. */ + +static inline stmt_vec_info +get_later_stmt (stmt_vec_info stmt1_info, stmt_vec_info stmt2_info) +{ + if (gimple_uid (vect_orig_stmt (stmt1_info)->stmt) + > gimple_uid (vect_orig_stmt (stmt2_info)->stmt)) + return stmt1_info; + else + return stmt2_info; +} + /* If STMT_INFO has been replaced by a pattern statement, return the replacement statement, otherwise return STMT_INFO itself. */ |