public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Internal compiler error building libstdc++ for vax
@ 2018-03-15 13:40 coypu
  2018-03-19 21:46 ` coypu
  0 siblings, 1 reply; 7+ messages in thread
From: coypu @ 2018-03-15 13:40 UTC (permalink / raw)
  To: gcc; +Cc: coypu

Hi folks,

netbsd's copy of GCC differs enough that it fails elsewhere with
gcc-trunk, but the problematic code is upstream.

updating netbsd to gcc 6.4.0, I get an internal compiler error building
libstdc++. (Long version: http://gnats.netbsd.org/53039)

Short version:

test.cc: In function 'bool std::atomic_flag_test_and_set_explicit(std::__atomic_flag_base*, std::memory_order)':
test.cc:25:3: internal compiler error: in patch_jump_insn, at cfgrtl.c:1271

comment at cfgrtl.c:1271 suggests:
	  /* If the substitution doesn't succeed, die.  This can happen
	     if the back end emitted unrecognizable instructions or if
	     target is exit block on some arches.  */
	  if (!redirect_jump (as_a <rtx_jump_insn *> (insn),
			      block_label (new_bb), 0))
	    {
	      gcc_assert (new_bb == EXIT_BLOCK_PTR_FOR_FN (cfun));

so it's saying the backend is generating garbage.

(gdb) call debug_insn_slim(insn)
   12: {pc={(zero_extract([r23:SI],0x1,0x1)!=0)?L14:pc};zero_extract([r23:SI],0x1,0x1)=0x1;}

I've found that if I modify vax/builtins.md:
@@ -61,7 +67,7 @@
   label = gen_label_rtx ();
   emit_move_insn (operands[0], const1_rtx);
-  emit_jump_insn (gen_jbbssi<mode> (operands[1], const0_rtx, label, operands[1]));
+  //emit_jump_insn (gen_jbbssi<mode> (operands[1], const0_rtx, label, operands[1]));
   emit_move_insn (operands[0], const0_rtx);
   emit_label (label);
   DONE;

it "fixes" my internal compiler error. However, I'm not sure what is
wrong with gen_jbbssi<mode>.

My current strategy of "just changing things and seeing if they help /
comparing to 50 examples of nearly identical code" doesn't appear
to be working despite many attempts :-)

Please help, thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-04-10 19:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-15 13:40 Internal compiler error building libstdc++ for vax coypu
2018-03-19 21:46 ` coypu
2018-03-19 22:03   ` Jeff Law
2018-04-02 16:15     ` coypu
2018-04-08 15:22       ` Jeff Law
2018-04-10 19:38         ` Maciej W. Rozycki
2018-04-11 19:24           ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).