[COMMITTED,ARC] Fix warning in arc_return_address_register.

Message ID 20180615111939.32343-1-claziss@gmail.com
State New
Headers show
Series
  • [COMMITTED,ARC] Fix warning in arc_return_address_register.
Related show

Commit Message

Claudiu Zissulescu June 15, 2018, 11:19 a.m.
The if condition in arc_return_address_register which selects the arc
return address is not correct as the brackets are incorect placed. The
issue is signalized in bugzilla 85968.

The patch is committed as obvious.

gcc/
2018-06-15  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.c (arc_return_address_register): Fix if-condition.
---
 gcc/ChangeLog        | 6 ++++++
 gcc/config/arc/arc.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

-- 
2.17.0

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8f95eb582f7..bf057e44926 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@ 
+2018-06-15  Claudiu Zissulescu  <claziss@synopsys.com>
+
+	PR target/85968
+	* config/arc/arc.c (arc_return_address_register): Fix
+	if-condition.
+
 2018-06-15  Richard Biener  <rguenther@suse.de>
 
 	PR middle-end/86076
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 477500cd0b2..4d4d248abf5 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -9818,7 +9818,7 @@  arc_return_address_register (unsigned int fn_type)
 
   if (ARC_INTERRUPT_P (fn_type))
     {
-      if (((fn_type & ARC_FUNCTION_ILINK1) | ARC_FUNCTION_FIRQ) != 0)
+      if ((fn_type & (ARC_FUNCTION_ILINK1 | ARC_FUNCTION_FIRQ)) != 0)
         regno = ILINK1_REGNUM;
       else if ((fn_type & ARC_FUNCTION_ILINK2) != 0)
         regno = ILINK2_REGNUM;