]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AVR: ad target/84211 - Fix dumping INSN_UID for null insn.
authorGeorg-Johann Lay <avr@gjlay.de>
Wed, 4 Dec 2024 15:08:15 +0000 (16:08 +0100)
committerGeorg-Johann Lay <avr@gjlay.de>
Wed, 4 Dec 2024 15:54:57 +0000 (16:54 +0100)
gcc/
PR target/84211
* config/avr/avr-passes.cc (insninfo_t) <m_insn>: Preset to 0.
(run_find_plies) [hamm=0, dump_file]: Don't print INSN_UID
for a null m_insn.

gcc/config/avr/avr-passes.cc

index 076d8cbe365e7ecb3e5337fb9844a94a9c1f1569..f89a534bcbd94551c28ff3623bad7f4f70cc05b8 100644 (file)
@@ -979,12 +979,12 @@ struct insninfo_t
   // This is an insn that sets the m_size bytes of m_regno to either
   // - A compile time constant m_isrc (m_code = CONST_INT), or
   // - The contents of register number m_rsrc (m_code = REG).
-  int m_size;
+  int m_size = 0;
   int m_regno;
   int m_rsrc;
   rtx_code m_code;
   uint64_t m_isrc;
-  rtx_insn *m_insn;
+  rtx_insn *m_insn = nullptr;
   rtx m_set = NULL_RTX;
   rtx m_src = NULL_RTX;
   int m_scratch = 0; // 0 or the register number of a QImode scratch.
@@ -2466,7 +2466,8 @@ bbinfo_t::run_find_plies (const insninfo_t &ii, const memento_t &memo) const
 
   if (hamm == 0)
     {
-      avr_dump (";; Found redundant insn %d\n", INSN_UID (ii.m_insn));
+      avr_dump (";; Found redundant insn %d\n",
+               ii.m_insn ? INSN_UID (ii.m_insn) : 0);
       return true;
     }