From: Richard Biener Date: Mon, 2 Nov 2020 07:59:02 +0000 (+0100) Subject: tree-optimization/97650 - fix ICE in vect_get_and_check_slp_defs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a159081ad4259c42456bd3dc2b637747c373c5a5;p=gcc.git tree-optimization/97650 - fix ICE in vect_get_and_check_slp_defs I was mistaken to treat vect_external_def as only applying to SSA_NAME defs, so check for that. 2020-11-02 Richard Biener PR tree-optimization/97650 * tree-vect-slp.c (vect_get_and_check_slp_defs): Check for SSA_NAME before checking SSA_NAME_IS_DEFAULT_DEF. * gcc.dg/vect/bb-slp-pr97650.c: New testcase. --- diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr97650.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr97650.c new file mode 100644 index 00000000000..f9c91fb5827 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr97650.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-Os -fallow-store-data-races" } */ + +short a=0; +unsigned long *volatile *volatile *volatile *b; +unsigned long *volatile *volatile *volatile **c[7]; +void d() { + short e=0; + for (; a;) { + e = 0; + for (; e < 7; e++) + c[e] = &b; + } +} +int main() { return 0; } diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 56dc59e11a6..d5249196d5e 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -530,6 +530,7 @@ vect_get_and_check_slp_defs (vec_info *vinfo, unsigned char swap, if (backedge && dts[i] == vect_external_def && is_a (vinfo) + && TREE_CODE (oprnd) == SSA_NAME && !SSA_NAME_IS_DEFAULT_DEF (oprnd) && !dominated_by_p (CDI_DOMINATORS, as_a (vinfo)->bbs[0],