This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/54963] [4.8 Regression] Wrong code generated for libgfortran/generated/eoshift3_8.c on SH
- From: "olegendo at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 29 Oct 2012 11:13:19 +0000
- Subject: [Bug target/54963] [4.8 Regression] Wrong code generated for libgfortran/generated/eoshift3_8.c on SH
- Auto-submitted: auto-generated
- References: <bug-54963-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54963
--- Comment #5 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-29 11:13:19 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
> > Created attachment 28551 [details]
> > Proposed patch
> >
> > This patch fixes the problem, by using 'emit_move_insn' instead of manually
> > doing the DImode reg copy.
>
> Does the pattern in negdi_cond
>
> emit_insn (gen_negc (low_dst, low_src));
> emit_label_after (skip_neg_label, emit_insn (gen_negc (high_dst, high_src)));
>
> work in the problematic situation? Perhaps I've missed something.
Ugh, you're right. The negdi will go wrong if input and output regs overlap.
I guess making the output operand a "=&r" for DImode should fix the issue (as
it's done in the adddi3 or subdi3 patterns). Moreover, I think it should be OK
to split up the absdi pattern before reload, except for negdi_cond. I'll try
that out.