Re: [patch] Fix segfault in vectorizer

2016-06-01 Thread Eric Botcazou
> Surely any missing vectype for a statement due to this delay is a bug. I > didn't notice STMT_VINFO_LIVE_P should be checked in addition to > STMT_VINFO_RELEVANT_P. In fact this brings back PR tree-opt/68327 on the 6 branch: (gdb) frame 0 #0 internal_error (gmsgid=gmsgid@entry=0x170cd58 "in %

Re: [patch] Fix segfault in vectorizer

2016-06-01 Thread Richard Biener
On Tue, May 31, 2016 at 7:46 PM, Eric Botcazou wrote: >> This code appears when we try to disable boolean patterns. Boolean patterns >> replace booleans with integers of proper size which allow us to simply >> determine vectype using get_vectype_for_scalar_type. With no such >> replacement we ca

Re: [patch] Fix segfault in vectorizer

2016-05-31 Thread Eric Botcazou
> This code appears when we try to disable boolean patterns. Boolean patterns > replace booleans with integers of proper size which allow us to simply > determine vectype using get_vectype_for_scalar_type. With no such > replacement we can't determine vectype just out of a scalar type (there are

Re: [patch] Fix segfault in vectorizer

2016-05-31 Thread Ilya Enkovich
2016-05-31 12:25 GMT+03:00 Richard Biener : > On Tue, May 31, 2016 at 10:22 AM, Eric Botcazou wrote: >> Hi, >> >> it's a regression present on the mainline and 6 branch: for the attached Ada >> testcase, optab_for_tree_code segfaults because the function is invoked on a >> NULL_TREE vectype_out fr

Re: [patch] Fix segfault in vectorizer

2016-05-31 Thread Eric Botcazou
> I recall that some STMT_VINFO_RELEVANT_P checks have a || > STMT_VINFO_DEF_TYPE () == vect_reduction_def > or VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE ()). It's rather || STMT_VINFO_LIVE_P in most cases and this works here, the vectorization is properly blocked: opt56.adb:9:29: note: not

Re: [patch] Fix segfault in vectorizer

2016-05-31 Thread Richard Biener
On Tue, May 31, 2016 at 11:46 AM, Eric Botcazou wrote: >> Note that vect_determine_vectorization_factor is supposed to set the >> vector type on all >> stmts. That it doesn't is a bug. Do you run into the else branch? > > Yes, for > > result_15 = _6 & result_3; > > wich is a BIT_AND_EXPR, henc

Re: [patch] Fix segfault in vectorizer

2016-05-31 Thread Eric Botcazou
> Note that vect_determine_vectorization_factor is supposed to set the > vector type on all > stmts. That it doesn't is a bug. Do you run into the else branch? Yes, for result_15 = _6 & result_3; wich is a BIT_AND_EXPR, hence accepted by vectorizable_reduction. > I think that should only tr

Re: [patch] Fix segfault in vectorizer

2016-05-31 Thread Richard Biener
On Tue, May 31, 2016 at 10:22 AM, Eric Botcazou wrote: > Hi, > > it's a regression present on the mainline and 6 branch: for the attached Ada > testcase, optab_for_tree_code segfaults because the function is invoked on a > NULL_TREE vectype_out from the vectorizer (vectorizable_reduction): > > i

[patch] Fix segfault in vectorizer

2016-05-31 Thread Eric Botcazou
Hi, it's a regression present on the mainline and 6 branch: for the attached Ada testcase, optab_for_tree_code segfaults because the function is invoked on a NULL_TREE vectype_out from the vectorizer (vectorizable_reduction): if (STMT_VINFO_VEC_REDUCTION_TYPE (stmt_info) == TREE_CODE_REDUCTIO