Fix 2 ia64-linux gas testsuite failures.
authorJim Wilson <wilson@tuliptree.org>
Thu, 5 Jul 2001 02:30:21 +0000 (02:30 +0000)
committerJim Wilson <wilson@tuliptree.org>
Thu, 5 Jul 2001 02:30:21 +0000 (02:30 +0000)
* config/tc-ia64.c (is_conditional_branch): Rewrite to exclude mod
sched branches.

gas/ChangeLog
gas/config/tc-ia64.c

index 5f2137fe94813d1f55859c097e36fcf84ee9e95d..9464ac713587d8b8ad4fba9ef6dd81945b58ef44 100644 (file)
@@ -1,3 +1,8 @@
+2001-07-04  Jim Wilson  <wilson@redhat.com>
+
+       * config/tc-ia64.c (is_conditional_branch): Rewrite to exclude mod
+       sched branches.
+
 2001-07-05  Ben Elliston  <bje@redhat.com>
 
        * read.c (s_fill): Correct spelling error in comments.
index 0a3dcc63e2667d1b850de6951f15ea45b4a5ad33..5ba81575d36de8a43c3d18e3208a5c05f2114225 100644 (file)
@@ -6914,19 +6914,29 @@ ia64_canonicalize_symbol_name (name)
   return name;
 }
 
-/* Return true if idesc is a conditional branch instruction.  */
+/* Return true if idesc is a conditional branch instruction.  This excludes
+   the modulo scheduled branches, and br.ia.  Mod-sched branches are excluded
+   because they always read/write resources regardless of the value of the
+   qualifying predicate.  br.ia must always use p0, and hence is always
+   taken.  Thus this function returns true for branches which can fall
+   through, and which use no resources if they do fall through.  */
 
 static int
 is_conditional_branch (idesc)
      struct ia64_opcode *idesc;
 {
   /* br is a conditional branch.  Everything that starts with br. except
-     br.ia is a conditional branch.  Everything that starts with brl is a
-     conditional branch.  */
+     br.ia, br.c{loop,top,exit}, and br.w{top,exit} is a conditional branch.
+     Everything that starts with brl is a conditional branch.  */
   return (idesc->name[0] == 'b' && idesc->name[1] == 'r'
          && (idesc->name[2] == '\0'
-             || (idesc->name[2] == '.' && idesc->name[3] != 'i')
-             || idesc->name[2] == 'l'));
+             || (idesc->name[2] == '.' && idesc->name[3] != 'i'
+                 && idesc->name[3] != 'c' && idesc->name[3] != 'w')
+             || idesc->name[2] == 'l'
+             /* br.cond, br.call, br.clr  */
+             || (idesc->name[2] == '.' && idesc->name[3] == 'c'
+                 && (idesc->name[4] == 'a' || idesc->name[4] == 'o'
+                     || (idesc->name[4] == 'l' && idesc->name[5] == 'r')))));
 }
 
 /* Return whether the given opcode is a taken branch.  If there's any doubt,