From 5867f2e2ee187cf104626c40de7765cfe6f7af50 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 7 Apr 2016 10:55:12 -0400 Subject: [PATCH 34/91] FIXME: handle note-specific data for NOTE_INSN_BASIC_BLOCK --- gcc/read-rtl.c | 32 ++++++++++++++++++++++++++++++++ test-loop.cleaned.rtl | 8 ++++---- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c index ad5e847..93ec910 100644 --- a/gcc/read-rtl.c +++ b/gcc/read-rtl.c @@ -36,6 +36,10 @@ along with GCC; see the file COPYING3. If not see #include "read-md.h" #include "gensupport.h" +#ifndef GENERATOR_FILE +#include "diagnostic.h" +#endif + /* One element in a singly-linked list of (integer, string) pairs. */ struct map_value { struct map_value *next; @@ -1307,6 +1311,34 @@ read_rtx_code (const char *code_name) unread_char (')'); #endif } + else if (i == 3 && code == NOTE) + { + /* Note-specific data appears for operand 3, which annoyingly + is before the enum specifying which kind of note we have + (operand 4). */ +#ifndef GENERATOR_FILE + if (0) + inform (rtx_reader_ptr->get_current_location (), + "note-specific data here"); + c = read_skip_spaces (); + if (c == '[') + { + /* Possibly data for a NOTE_INSN_BASIC_BLOCK, of the form: + [bb %d]. */ + file_location bb_loc = read_name (&name); + if (strcmp (name.string, "bb")) + error_at (bb_loc, "was expecting %qs", "bb"); + file_location bb_idx_loc = read_name (&name); + /* FIXME: do something with this. */ + inform (bb_idx_loc, "got bb_idx_loc: %qs", name.string); + c = read_skip_spaces (); + if (c != ']') + fatal_expected_char (']', c); + } + else + unread_char (c); +#endif /* #ifndef GENERATOR_FILE */ + } break; case 'e': diff --git a/test-loop.cleaned.rtl b/test-loop.cleaned.rtl index 2f39d1f..84ae52a 100644 --- a/test-loop.cleaned.rtl +++ b/test-loop.cleaned.rtl @@ -13,7 +13,7 @@ ;; Full RTL generated for this function: ;; (note 1 0 6 (nil) NOTE_INSN_DELETED) -;;(note 6 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK) +(note 6 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK) (insn 2 6 3 2 (set (mem/c:SI (plus:DI (reg/f:DI 82 virtual-stack-vars) (const_int -4 [0xfffffffffffffffc])) [1 i+0 S4 A32]) (reg:SI 5 di [ i ])) ../../src/test-loop.c:2 -1 @@ -43,7 +43,7 @@ (pc))) ../../src/test-loop.c:3 -1 (nil) -> 16) -;;(note 11 10 12 4 [bb 4] NOTE_INSN_BASIC_BLOCK) +(note 11 10 12 4 [bb 4] NOTE_INSN_BASIC_BLOCK) (insn 12 11 13 4 (set (reg:SI 90) (mem/c:SI (plus:DI (reg/f:DI 82 virtual-stack-vars) (const_int -12 [0xfffffffffffffff4])) [1 k+0 S4 A32])) ../../src/test-loop.c:4 -1 @@ -64,7 +64,7 @@ -> 20) (barrier 15 14 16) (code_label 16 15 17 5 2 "" [1 uses]) -;;(note 17 16 18 5 [bb 5] NOTE_INSN_BASIC_BLOCK) +(note 17 16 18 5 [bb 5] NOTE_INSN_BASIC_BLOCK) (insn 18 17 19 5 (set (reg:SI 91) (mem/c:SI (plus:DI (reg/f:DI 82 virtual-stack-vars) (const_int -12 [0xfffffffffffffff4])) [1 k+0 S4 A32])) ../../src/test-loop.c:6 -1 @@ -78,7 +78,7 @@ (const_int -12 [0xfffffffffffffff4])) [1 k+0 S4 A32])) (nil))) (code_label 20 19 21 6 3 "" [1 uses]) -;;(note 21 20 22 6 [bb 6] NOTE_INSN_BASIC_BLOCK) +(note 21 20 22 6 [bb 6] NOTE_INSN_BASIC_BLOCK) /* (insn 22 21 26 6 (set (reg:SI 88 [ ]) (reg:SI 87 [ _1 ])) -1 (nil)) */ -- 1.8.5.3