--- Comment #2 from Kazumoto Kojima <kkojima at gcc dot> ---
Looks not enough.  Even with the patch, I got a similar ICE for lto case
in testsuite:

FAIL: gcc.dg/atomic/stdatomic-op-1.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  (internal compiler error)

gcc.log says

/exp/ldroot/dodes/ORIG/trunk/gcc/testsuite/gcc.dg/atomic/stdatomic-op-1.c: In
function 'main':
error: invalid rtl sharing found in the insn
(insn 1527 292 294 23 (set (reg:SI 147 t)
        (eq:SI (subreg:SI (reg:QI 559) 0)
            (const_int 0 [0])))
error: shared rtx
(subreg:SI (reg:QI 559) 0)
internal compiler error: internal consistency failure
0x829cca7 verify_rtx_sharing

and it went away with the patch below.

diff --git a/config/sh/ b/config/sh/
index c6956a0..667a9a5 100644
--- a/config/sh/
+++ b/config/sh/
@@ -607,7 +607,7 @@
              if (dump_file)
                fprintf (dump_file, "tstsi_t: converting to cmpeqsi_t\n");
-             emit_insn (gen_cmpeqsi_t (eop0.use_as_extended_reg (curr_insn),
+             emit_insn (gen_cmpeqsi_t (copy_rtx(eop0.use_as_extended_reg

Reply via email to