https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78695
--- Comment #11 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
Patch under test:
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c (revision 243506)
+++ gcc/config/rs6000/rs6000.c (working copy)
@@ -41433,6 +41433,12 @@ find_alignment_op (rtx_insn *insn, rtx base_reg)
if (!base_def_link || base_def_link->next)
break;
+ /* With stack-protector code enabled, and possibly in other
+ circumstances, there may not be an associated insn for
+ the def. */
+ if (!base_def_link->ref->base.insn_info)
+ break;
+
rtx_insn *and_insn = DF_REF_INSN (base_def_link->ref);
and_operation = alignment_mask (and_insn);
if (and_operation != 0)