diff mbox

[019/236] Strengthen return type of gen_label_rtx

Message ID 1407345815-14551-20-git-send-email-dmalcolm@redhat.com
State New
Headers show

Commit Message

David Malcolm Aug. 6, 2014, 5:19 p.m. UTC
gcc/
	* rtl.h (gen_label_rtx): Strengthen return type from rtx to
	rtx_code_label *.

	* emit-rtl.c (gen_label_rtx): Likewise.
---
 gcc/emit-rtl.c | 7 ++++---
 gcc/rtl.h      | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

Comments

Jeff Law Aug. 12, 2014, 10 p.m. UTC | #1
On 08/06/14 11:19, David Malcolm wrote:
> gcc/
> 	* rtl.h (gen_label_rtx): Strengthen return type from rtx to
> 	rtx_code_label *.
>
> 	* emit-rtl.c (gen_label_rtx): Likewise.
Presumably at some point we'll look at the gen_XXXXXXX and split out 
those which return items for the chain vs everything else.

OK.

Thanks,
jeff
David Malcolm Aug. 19, 2014, 6:10 p.m. UTC | #2
On Tue, 2014-08-12 at 16:00 -0600, Jeff Law wrote:
> On 08/06/14 11:19, David Malcolm wrote:
> > gcc/
> > 	* rtl.h (gen_label_rtx): Strengthen return type from rtx to
> > 	rtx_code_label *.
> >
> > 	* emit-rtl.c (gen_label_rtx): Likewise.
> Presumably at some point we'll look at the gen_XXXXXXX and split out 
> those which return items for the chain vs everything else.
> 
> OK.

Thanks; committed to trunk as r214179, having verified
bootstrap&regrtest on x86_64-unknown-linux-gnu (Fedora 20) albeit in
combination with patches 9-29 [1], and verified that it builds
standalone with 10 targets.

Dave
diff mbox

Patch

diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index c51b7d8..5175284 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2468,11 +2468,12 @@  set_mem_attrs_for_spill (rtx mem)
 
 /* Return a newly created CODE_LABEL rtx with a unique label number.  */
 
-rtx
+rtx_code_label *
 gen_label_rtx (void)
 {
-  return gen_rtx_CODE_LABEL (VOIDmode, NULL_RTX, NULL_RTX,
-			     NULL, label_num++, NULL);
+  return as_a <rtx_code_label *> (
+	    gen_rtx_CODE_LABEL (VOIDmode, NULL_RTX, NULL_RTX,
+				NULL, label_num++, NULL));
 }
 
 /* For procedure integration.  */
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 049f01e..a703e34 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2278,7 +2278,7 @@  extern rtx gen_reg_rtx (enum machine_mode);
 extern rtx gen_rtx_REG_offset (rtx, enum machine_mode, unsigned int, int);
 extern rtx gen_reg_rtx_offset (rtx, enum machine_mode, int);
 extern rtx gen_reg_rtx_and_attrs (rtx);
-extern rtx gen_label_rtx (void);
+extern rtx_code_label *gen_label_rtx (void);
 extern rtx gen_lowpart_common (enum machine_mode, rtx);
 
 /* In cse.c */