diff mbox

Small emit-rtl.c / reorg.c cleanup

Message ID yddd2sryw8w.fsf@lokon.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth May 16, 2013, 11:55 a.m. UTC
Steven Bosscher <stevenb.gcc@gmail.com> writes:

> This just removes one unused function, and moves two functions from
> emit-rtl.c to reorg.c which is the only place where they're used.
>
> Will commit in a few days, barring objections.
>
> Ciao!
> Steven
>
>
>         * rtl.h (next_label, skip_consecutive_labels, link_cc0_insns):
>         Remove prototypes.
>         * emit-rtl.c (next_label): Remove unused function.
>         (skip_consecutive_labels, link_cc0_insns): Move to ...
>         * reorg.c (skip_consecutive_labels, link_cc0_insns): ... here, the
>         only place where these functions are used.

Unfortunately, this patch broke SPARC bootstrap since it lost the
HAVE_cc0 guard around link_cc0_insns:

/vol/gcc/src/hg/trunk/local/gcc/reorg.c:164:1: error: 'void link_cc0_insns(rtx)' defined but not used [-Werror=unused-function]
 link_cc0_insns (rtx insn)
 ^
cc1plus: all warnings being treated as errors
make[3]: *** [reorg.o] Error 1

I'll install the obvious patch once testing on sparc-sun-solaris2.11 has
gotten into stage 3.

	Rainer


2013-05-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* reorg.c (link_cc0_insns): Wrap in #ifdef HAVE_cc0.

Comments

Steven Bosscher May 16, 2013, 5:34 p.m. UTC | #1
On Thu, May 16, 2013 at 1:55 PM, Rainer Orth wrote:
> Steven Bosscher writes:
>
> Unfortunately, this patch broke SPARC bootstrap since it lost the
> HAVE_cc0 guard around link_cc0_insns:

Oops...

I followed Bernhard's suggestion and made those two moved functions
static in reorg.c just before committing. Without "static" the
compiler bootstrapped but now it's an unused function (as it was
before but g++ doesn't complain about that).

Sorry for the breakage. Apparently I should test such seemingly
innocent changes anyway.

Ciao!
Steven
diff mbox

Patch

# HG changeset patch
# Parent 4901ecbded49adb7097c93614fa708cb6cd53695
Restore bootstrap on non-cc0 targets

diff --git a/gcc/reorg.c b/gcc/reorg.c
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -157,6 +157,7 @@  skip_consecutive_labels (rtx label)
   return label;
 }
 
+#ifdef HAVE_cc0
 /* INSN uses CC0 and is being moved into a delay slot.  Set up REG_CC_SETTER
    and REG_CC_USER notes so we can find it.  */
 
@@ -171,6 +172,7 @@  link_cc0_insns (rtx insn)
   add_reg_note (user, REG_CC_SETTER, insn);
   add_reg_note (insn, REG_CC_USER, user);
 }
+#endif
 
 /* Insns which have delay slots that have not yet been filled.  */