PATCH COMMITTED: Use alloc_reg_note to allocate register notes

Ian Lance Taylor iant@google.com
Thu Apr 16 16:13:00 GMT 2009


Register notes in RTL don't use the usual insn code values.  That means
that code like this:
  gen_rtx_EXPR_LIST (REG_DEAD, i3dest_killed, NULL_RTX)
is an enum error in C++: it passes a value of type enum reg_note to a
function that expects a value of type rtx_code.  I am testing a patch
for -Wc++-compat which warns about these enum mismatches.  That
-Wc++-compat patch doesn't bootstrap cleanly yet.  However, while
testing it, I developed this patch.  It cleans up the creation of
register notes by consistently using add_reg_note and a new function
alloc_reg_note.

I've bootstrapped and tested this patch independently on
i686-pc-linux-gnu.  I've committed it to mainline.

Ian


2009-04-16  Ian Lance Taylor  <iant@google.com>

	* rtlanal.c (alloc_reg_note): New function, broken out of
	add_reg_note.
	(add_reg_note): Call alloc_reg_note.
	* rtl.h (alloc_reg_note): Declare.
	* combine.c (try_combine): Use alloc_reg_note.
	(recog_for_combine, move_deaths): Likewise.
	(distribute_notes): Use alloc_reg_note and add_reg_note.
	* haifa-sched.c (sched_create_recovery_edges): Use add_reg_note.
	* combine-stack-adj.c (adjust_frame_related_expr): Likewise.
	* reload1.c (eliminate_regs_1): Use alloc_reg_note.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 8147 bytes
Desc: Use alloc_reg_note to allocate register notes
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090416/8148f21c/attachment.bin>


More information about the Gcc-patches mailing list