From cc7d87f5fb452ad8e5dcb8afbd0585629ee1c277 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 7 Apr 2016 16:50:05 -0400 Subject: [PATCH 39/91] FIXME: attempt to roundtrip the RTL --- gcc/rtl/rtl-frontend.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/rtl/rtl-frontend.c b/gcc/rtl/rtl-frontend.c index 63c7f4c..4840426 100644 --- a/gcc/rtl/rtl-frontend.c +++ b/gcc/rtl/rtl-frontend.c @@ -230,6 +230,8 @@ class function_reader : public rtx_reader rtx *get_insn_by_uid (int uid); + rtx_insn *get_first_insn () const { return m_first_insn; } + private: struct uid_hash : int_hash {}; hash_map m_insns_by_uid; @@ -429,6 +431,10 @@ rtl_langhook_parse_file (void) reader.create_function (); reader.apply_fixups (); + + FILE *out = fopen ("/tmp/roundtrip.rtl", "w"); + print_rtl_with_bb (out, reader.get_first_insn (), 1024); + fclose (out); } static tree -- 1.8.5.3