aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/read-rtl-function.c19
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/rtl/aarch64/rtl-handle-column-numbers.c23
4 files changed, 51 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 22fe571..9784821 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2019-11-15 Matthew Malcomson <matthew.malcomson@arm.com>
+
+ * read-rtl-function.c
+ (function_reader::add_fixup_source_location): Take additional
+ parameter of a column.
+ (function_reader::maybe_read_location): Optionally parse column
+ information and pass to add_fixup_source_location.
+
2019-11-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/92512
diff --git a/gcc/read-rtl-function.c b/gcc/read-rtl-function.c
index b87ea30..47dc66e 100644
--- a/gcc/read-rtl-function.c
+++ b/gcc/read-rtl-function.c
@@ -115,7 +115,7 @@ class function_reader : public rtx_reader
int operand_idx, int bb_idx);
void add_fixup_source_location (file_location loc, rtx_insn *insn,
- const char *filename, int lineno);
+ const char *filename, int lineno, int colno);
void add_fixup_expr (file_location loc, rtx x,
const char *desc);
@@ -1371,7 +1371,7 @@ function_reader::add_fixup_note_insn_basic_block (file_location loc, rtx insn,
void
function_reader::add_fixup_source_location (file_location, rtx_insn *,
- const char *, int)
+ const char *, int, int)
{
}
@@ -1557,7 +1557,20 @@ function_reader::maybe_read_location (rtx_insn *insn)
require_char (':');
struct md_name line_num;
read_name (&line_num);
- add_fixup_source_location (loc, insn, filename, atoi (line_num.string));
+
+ int column = 0;
+ int ch = read_char ();
+ if (ch == ':')
+ {
+ struct md_name column_num;
+ read_name (&column_num);
+ column = atoi (column_num.string);
+ }
+ else
+ unread_char (ch);
+ add_fixup_source_location (loc, insn, filename,
+ atoi (line_num.string),
+ column);
}
else
unread_char (ch);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 82f559b..b835d67 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2019-11-15 Matthew Malcomson <matthew.malcomson@arm.com>
+
+ * gcc.dg/rtl/aarch64/rtl-handle-column-numbers.c: New test.
+
2019-11-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/92512
diff --git a/gcc/testsuite/gcc.dg/rtl/aarch64/rtl-handle-column-numbers.c b/gcc/testsuite/gcc.dg/rtl/aarch64/rtl-handle-column-numbers.c
new file mode 100644
index 0000000..9290e1e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/rtl/aarch64/rtl-handle-column-numbers.c
@@ -0,0 +1,23 @@
+/* { dg-do compile { target aarch64-*-* } } */
+
+/* Should compile and not complain. */
+int __RTL (startwith ("cprop_hardreg"))
+foo ()
+{
+(function "f"
+ (insn-chain
+ (block 2
+ (edge-from entry (flags "FALLTHRU"))
+ (cnote 6 [bb 2] NOTE_INSN_BASIC_BLOCK)
+ (cinsn 100 (set (reg:DI x0)
+ (plus:DI
+ (reg:DI x1)
+ (const_int 16777213)))
+ "/home/user/somefile.c":10:3)
+ ;; Extra insn, to avoid all of the above from being deleted by DCE
+ (cinsn 10 (use (reg/i:DI x0)))
+ (edge-to exit (flags "FALLTHRU"))
+ ) ;; block 2
+ ) ;; insn-chain
+) ;; function
+}