https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68659
vries at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vries at gcc dot gnu.org --- Comment #17 from vries at gcc dot gnu.org --- (In reply to John David Anglin from comment #11) > Seeing this on hppa with -mschedule=7100LC. This is with r231795. > > There is null pointer exception here: > > Program received signal SIGSEGV, Segmentation fault. > translate_isl_ast_to_gimple::collect_all_ssa_names ( > this=this@entry=0xfd703908, new_expr=0x0, > vec_ssa=vec_ssa@entry=0xfd7044c8) > at ../../gcc/gcc/graphite-isl-ast-to-gimple.c:1603 > 1603 if (TREE_CODE (new_expr) == SSA_NAME) > (gdb) p new_expr > $1 = (tree) 0x0 I wonder if this patch is correct (at least fixes the ICE with x86_64 -m32): ... index d3614e4..e5b03ee 100644 --- a/gcc/graphite-isl-ast-to-gimple.c +++ b/gcc/graphite-isl-ast-to-gimple.c @@ -1404,6 +1404,9 @@ void translate_isl_ast_to_gimple:: collect_all_ssa_names (tree new_expr, vec<tree> *vec_ssa) { + if (new_expr == NULL_TREE) + return; + /* Rename all uses in new_expr. */ if (TREE_CODE (new_expr) == SSA_NAME) { @@ -1804,6 +1807,9 @@ get_new_name (basic_block new_bb, tree op, if (is_constant (op)) return op; + if (TREE_CODE (op) == ADDR_EXPR) + return op; + return get_rename (new_bb, op, old_bb, phi_kind); } ... We're doing collect_all_ssa_names for component_ref u2.buf. Operand 2 is NULL_TREE, which AFAIU according to the definition of component_ref is allowed (tree.def: Operand 2, if present, ...). This code in collect_all_ssa_names just looks at TREE_CODE_LENGTH, which is 3 for component_ref, and for i == 2, op == NULL_TREE: ... /* Iterate over SSA_NAMES in NEW_EXPR. */ for (int i = 0; i < (TREE_CODE_LENGTH (TREE_CODE (new_expr))); i++) { tree op = TREE_OPERAND (new_expr, i); collect_all_ssa_names (op, vec_ssa); } ... The first bit of the patch allows the NULL_TREE operand in collect_all_ssa_names. But subsequently, we run into handling op == &u2.buf in get_new_name, which results in an assert that op is not an ssa-name in get_rename. The last bit of the patch handles that.