This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] ia64: accept alternative forms of .pred.rel
- From: "Jan Beulich" <JBeulich at novell dot com>
- To: <binutils at sources dot redhat dot com>
- Date: Mon, 31 Jan 2005 17:32:38 +0100
- Subject: [PATCH] ia64: accept alternative forms of .pred.rel
Change to allow ias forms of .pred.rel (with @-prefixed designators).
Also
eliminate a memory leak in the original code dealing with the quoted
form.
Built and tested on ia64-unknown-linux-gnu.
Jan
gas/
2005-01-31 Jan Beulich <jbeulich@novell.com>
* config/tc-ia64.c (dot_pred_rel): Update comment. Handle
@-prefixed
designators along with quoted ones. Free copy of quoted
designator
when done.
gas/testsuite/
2005-01-31 Jan Beulich <jbeulich@novell.com>
* gas/ia64/pred-rel.s: New.
* gas/ia64/ia64.exp: Run new test.
---
/home/jbeulich/src/binutils/mainline/2005-01-31/gas/config/tc-ia64.c 2005-01-28
09:16:03.000000000 +0100
+++ 2005-01-31/gas/config/tc-ia64.c 2005-01-31 17:20:05.409146225
+0100
@@ -4773,9 +4773,9 @@ print_prmask (mask)
}
/*
- .pred.rel.clear [p1 [,p2 [,...]]] (also .pred.rel "clear")
- .pred.rel.imply p1, p2 (also .pred.rel "imply")
- .pred.rel.mutex p1, p2 [,...] (also .pred.rel "mutex")
+ .pred.rel.clear [p1 [,p2 [,...]]] (also .pred.rel "clear" or
@clear)
+ .pred.rel.imply p1, p2 (also .pred.rel "imply" or
@imply)
+ .pred.rel.mutex p1, p2 [,...] (also .pred.rel "mutex" or
@mutex)
.pred.safe_across_calls p1 [, p2 [,...]]
*/
@@ -4789,28 +4789,43 @@ dot_pred_rel (type)
if (type == 0)
{
- if (*input_line_pointer != '"')
- {
- as_bad (_("Missing predicate relation type"));
- ignore_rest_of_line ();
- return;
- }
- else
+ if (*input_line_pointer == '"')
{
int len;
char *form = demand_copy_C_string (&len);
+
if (strcmp (form, "mutex") == 0)
type = 'm';
else if (strcmp (form, "clear") == 0)
type = 'c';
else if (strcmp (form, "imply") == 0)
type = 'i';
- else
- {
- as_bad (_("Unrecognized predicate relation type"));
- ignore_rest_of_line ();
- return;
- }
+ obstack_free (¬es, form);
+ }
+ else if (*input_line_pointer == '@')
+ {
+ char *form = ++input_line_pointer;
+ char c = get_symbol_end();
+
+ if (strcmp (form, "mutex") == 0)
+ type = 'm';
+ else if (strcmp (form, "clear") == 0)
+ type = 'c';
+ else if (strcmp (form, "imply") == 0)
+ type = 'i';
+ *input_line_pointer = c;
+ }
+ else
+ {
+ as_bad (_("Missing predicate relation type"));
+ ignore_rest_of_line ();
+ return;
+ }
+ if (type == 0)
+ {
+ as_bad (_("Unrecognized predicate relation type"));
+ ignore_rest_of_line ();
+ return;
}
if (*input_line_pointer == ',')
++input_line_pointer;
---
/home/jbeulich/src/binutils/mainline/2005-01-31/gas/testsuite/gas/ia64/ia64.exp 2005-01-27
10:09:57.000000000 +0100
+++ 2005-01-31/gas/testsuite/gas/ia64/ia64.exp 2005-01-31
17:20:05.410122787 +0100
@@ -35,6 +35,7 @@ if [istarget "ia64-*"] then {
run_dump_test "dv-branch"
run_dump_test "dv-imply"
run_dump_test "dv-mutex"
+ gas_test "pred-rel.s" "" "" ".pred.rel alternative forms"
run_dump_test "dv-safe"
run_dump_test "dv-srlz"
run_dump_test "tls"
---
/home/jbeulich/src/binutils/mainline/2005-01-31/gas/testsuite/gas/ia64/pred-rel.s 1970-01-01
01:00:00.000000000 +0100
+++ 2005-01-31/gas/testsuite/gas/ia64/pred-rel.s 2005-01-31
16:39:14.000000000 +0100
@@ -0,0 +1,21 @@
+// Make sure all forms of .pred.rel are accepted
+_start:
+ .pred.rel "mutex", p1, p2
+ .pred.rel "imply", p2, p3
+ .pred.rel "clear", p1, p2, p3
+
+ .pred.rel "mutex" p1, p2
+ .pred.rel "imply" p2, p3
+ .pred.rel "clear" p1, p2, p3
+
+ .pred.rel.mutex p1, p2
+ .pred.rel.imply p2, p3
+ .pred.rel.clear p1, p2, p3
+
+ .pred.rel @mutex, p1, p2
+ .pred.rel @imply, p2, p3
+ .pred.rel @clear, p1, p2, p3
+
+ .pred.rel @mutex p1, p2
+ .pred.rel @imply p2, p3
+ .pred.rel @clear p1, p2, p3