On 2024-12-18 14:59, Richard Earnshaw (lists) wrote:
On 17/12/2024 21:01, Torbjörn SVENSSON wrote:
Regtested for arm-none-eabi (Cortex-M0/M23/M33/M55/M85).
Ok for trunk?
--
Without the escape of the tab, newline and semicolon, the generated
assembler output will not match the expected assmbler in the test cases.
Fixes Linaro CI reported regression on r15-6166-gb7e11b499922 in
https://linaro.atlassian.net/browse/GNU-1464.
gcc/ChangeLog:
* config/arm/thumb1.md (thumb1_cbz): Escape tab, newline and
semicolon.
Signed-off-by: Torbjörn SVENSSON <torbjorn.svens...@foss.st.com>
---
gcc/config/arm/thumb1.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/config/arm/thumb1.md b/gcc/config/arm/thumb1.md
index b4d7c6ea981..09c4e81c1cc 100644
--- a/gcc/config/arm/thumb1.md
+++ b/gcc/config/arm/thumb1.md
@@ -1145,9 +1145,9 @@ (define_insn "thumb1_cbz"
switch (get_attr_length (insn))
{
- case 4: return "b%d0\t%l2";
- case 6: return "b%D0\t.LCB%=;b\t%l2\t%@long jump\n.LCB%=:";
- case 8: return "b%D0\t.LCB%=;bl\t%l2\t%@far jump\n.LCB%=:";
+ case 4: return \"b%d0\\t%l2\";
+ case 6: return \"b%D0\\t.LCB%=\;b\\t%l2\\t%@long jump\\n.LCB%=:\";
+ case 8: return \"b%D0\\t.LCB%=\;bl\\t%l2\\t%@far jump\\n.LCB%=:\";
default: gcc_unreachable ();
This is overkill. There was a time when this was necessary, but it's mostly not needed
here. This particular pattern uses the 'braced text' way of encapsulating the C fragment
(ie the C fragment is enclosed in {} rather than ""), so quoting the C string
is not needed. Secondly, md-read.cc will now pass through \t unchanged. So that only
leaves \; which has special meaning in output templates (see
md-read.cc:md_reader::read_escape () for the full details).
My knowledge of the .md magic is limited, but I'm trying to understand
how it works. (In case anyone reads this in the future, the mentioned
md-read.cc is actually named read-md.cc).
Due to the lack of better understanding, I looked how other blocks
looked like and just replicated those. That's why I escaped both the
quotation and the whitespace in addition to the semicolon.
In summary, we only need to escape the semicolons within the strings in cases 6
and 8.
I've done a build and tested the particular test case on Cortex-M23 that
triggered the report from the Linaro CI and it works fine with just
escaping the semicolon and leaving the rest.
Pushed as r15-6340-g15dbb0a9ee8.
Kind regards,
Torbjörn
OK with that change.
R.