re PR tree-optimization/46985 (ICE: SIGSEGV in is_gimple_min_invariant (gimple.c:2742) with -fno-tree-ccp -fno-tree-dominator-opts -fno-tree-fre)

PR tree-optimization/46985
	* tree-scalar-evolution.c (instantiate_scev_r): If chrec is NULL,
	return it immediately.

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

From-SVN: r168027
This commit is contained in:
Jakub Jelinek 2010-12-18 19:15:10 +01:00 committed by Jakub Jelinek
parent 16923e7bf3
commit 81fada9aa7
4 changed files with 30 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2010-12-18 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/46985
* tree-scalar-evolution.c (instantiate_scev_r): If chrec is NULL,
return it immediately.
2010-12-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/46915

View File

@ -1,3 +1,8 @@
2010-12-18 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/46985
* gfortran.dg/pr46985.f90: New test.
2010-12-18 Eric Botcazou <ebotcazou@adacore.com>
PR tree-optimization/46232

View File

@ -0,0 +1,17 @@
! PR tree-optimization/46985
! { dg-do compile }
! { dg-options "-O -ftree-pre -ftree-vrp -fno-tree-ccp -fno-tree-dominator-opts -fno-tree-fre" }
type :: t
integer :: i
end type t
type(t), target :: tar(2) = (/t(2), t(4)/)
integer, pointer :: ptr(:)
ptr => tar%i
call foo (ptr)
contains
subroutine foo (arg)
integer :: arg(:)
arg = arg - 1
end subroutine
end

View File

@ -2616,7 +2616,8 @@ instantiate_scev_r (basic_block instantiate_below,
if (size_expr++ > PARAM_VALUE (PARAM_SCEV_MAX_EXPR_SIZE))
return chrec_dont_know;
if (automatically_generated_chrec_p (chrec)
if (chrec == NULL_TREE
|| automatically_generated_chrec_p (chrec)
|| is_gimple_min_invariant (chrec))
return chrec;