Spotted by David Binderman and cppcheck, thanks. The interesting cases wouldn't be exposed by a cris-elf build, but I made a regtest-run nonetheless: the fix has actually been in our local tree for quite some time together with TLS for CRIS v32 so I'm not worried about fallout. (Upstreaming that? Hm... one excuse I use is that I've been waiting for TLS for CRIS v10 to materialize for the Linux kernel, along the v32 lines but using $IRP, but that never happened.)
PR target/59203 * config/cris/cris.c (cris_pic_symbol_type_of): Fix typo, checking t1 twice instead of t1 and t2 respectively. Index: gcc/config/cris/cris.c =================================================================== --- gcc/config/cris/cris.c (revision 206176) +++ gcc/config/cris/cris.c (working copy) @@ -2493,7 +2493,7 @@ cris_pic_symbol_type_of (const_rtx x) gcc_assert (t1 == cris_no_symbol || t2 == cris_no_symbol); - if (t1 == cris_got_symbol || t1 == cris_got_symbol) + if (t1 == cris_got_symbol || t2 == cris_got_symbol) return cris_got_symbol_needing_fixup; return t1 != cris_no_symbol ? t1 : t2; brgds, H-P