]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386.c (indirect_thunk_name): Declare regno as unsigned int.
authorUros Bizjak <ubizjak@gmail.com>
Wed, 17 Jan 2018 15:58:48 +0000 (16:58 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 17 Jan 2018 15:58:48 +0000 (16:58 +0100)
* config/i386/i386.c (indirect_thunk_name): Declare regno
as unsigned int.  Compare regno with INVALID_REGNUM.
(output_indirect_thunk): Ditto.
(output_indirect_thunk_function): Ditto.
(ix86_code_end): Declare regno as unsigned int.  Use INVALID_REGNUM
in the call to output_indirect_thunk_function.

From-SVN: r256797

gcc/ChangeLog
gcc/config/i386/i386.c

index 4c519879fcbd003f4c43ac39224011aec83cf94b..2945d4c89d0d7ad604ef6b199f0eed29da961795 100644 (file)
@@ -1,3 +1,12 @@
+2018-01-17  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.c (indirect_thunk_name): Declare regno
+       as unsigned int.  Compare regno with INVALID_REGNUM.
+       (output_indirect_thunk): Ditto.
+       (output_indirect_thunk_function): Ditto.
+       (ix86_code_end): Declare regno as unsigned int.  Use INVALID_REGNUM
+       in the call to output_indirect_thunk_function.
+
 2018-01-17  Richard Sandiford  <richard.sandiford@linaro.org>
 
        PR middle-end/83884
        * config/alpha/alpha.md (*saddsi_1): New insn_ans_split pattern.
        (*saddl_se_1): Ditto.
        (*ssubsi_1): Ditto.
-       (*saddl_se_1): Ditto.
+       (*ssubl_se_1): Ditto.
 
 2018-01-12  Richard Sandiford  <richard.sandiford@linaro.org>
 
index 6dd6bfd5de881659855491963c0c19be2a6522b7..cb0f4ed5e6a3be1ec33afdcbe927fc0ab522db98 100644 (file)
@@ -10765,16 +10765,16 @@ static int indirect_thunks_bnd_used;
 /* Fills in the label name that should be used for the indirect thunk.  */
 
 static void
-indirect_thunk_name (char name[32], int regno, bool need_bnd_p,
-                    bool ret_p)
+indirect_thunk_name (char name[32], unsigned int regno,
+                    bool need_bnd_p, bool ret_p)
 {
-  if (regno >= 0 && ret_p)
+  if (regno != INVALID_REGNUM && ret_p)
     gcc_unreachable ();
 
   if (USE_HIDDEN_LINKONCE)
     {
       const char *bnd = need_bnd_p ? "_bnd" : "";
-      if (regno >= 0)
+      if (regno != INVALID_REGNUM)
        {
          const char *reg_prefix;
          if (LEGACY_INT_REGNO_P (regno))
@@ -10792,7 +10792,7 @@ indirect_thunk_name (char name[32], int regno, bool need_bnd_p,
     }
   else
     {
-      if (regno >= 0)
+      if (regno != INVALID_REGNUM)
        {
          if (need_bnd_p)
            ASM_GENERATE_INTERNAL_LABEL (name, "LITBR", regno);
@@ -10844,7 +10844,7 @@ indirect_thunk_name (char name[32], int regno, bool need_bnd_p,
  */
 
 static void
-output_indirect_thunk (bool need_bnd_p, int regno)
+output_indirect_thunk (bool need_bnd_p, unsigned int regno)
 {
   char indirectlabel1[32];
   char indirectlabel2[32];
@@ -10874,7 +10874,7 @@ output_indirect_thunk (bool need_bnd_p, int regno)
 
   ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, indirectlabel2);
 
-  if (regno >= 0)
+  if (regno != INVALID_REGNUM)
     {
       /* MOV.  */
       rtx xops[2];
@@ -10898,12 +10898,12 @@ output_indirect_thunk (bool need_bnd_p, int regno)
 }
 
 /* Output a funtion with a call and return thunk for indirect branch.
-   If BND_P is true, the BND prefix is needed.   If REGNO != -1,  the
-   function address is in REGNO.  Otherwise, the function address is
+   If BND_P is true, the BND prefix is needed.  If REGNO != UNVALID_REGNUM,
+   the function address is in REGNO.  Otherwise, the function address is
    on the top of stack.  */
 
 static void
-output_indirect_thunk_function (bool need_bnd_p, int regno)
+output_indirect_thunk_function (bool need_bnd_p, unsigned int regno)
 {
   char name[32];
   tree decl;
@@ -10952,7 +10952,7 @@ output_indirect_thunk_function (bool need_bnd_p, int regno)
        ASM_OUTPUT_LABEL (asm_out_file, name);
       }
 
-  if (regno < 0)
+  if (regno == INVALID_REGNUM)
     {
       /* Create alias for __x86.return_thunk/__x86.return_thunk_bnd.  */
       char alias[32];
@@ -11026,16 +11026,16 @@ static void
 ix86_code_end (void)
 {
   rtx xops[2];
-  int regno;
+  unsigned int regno;
 
   if (indirect_thunk_needed)
-    output_indirect_thunk_function (false, -1);
+    output_indirect_thunk_function (false, INVALID_REGNUM);
   if (indirect_thunk_bnd_needed)
-    output_indirect_thunk_function (true, -1);
+    output_indirect_thunk_function (true, INVALID_REGNUM);
 
   for (regno = FIRST_REX_INT_REG; regno <= LAST_REX_INT_REG; regno++)
     {
-      int i = regno - FIRST_REX_INT_REG + LAST_INT_REG + 1;
+      unsigned int i = regno - FIRST_REX_INT_REG + LAST_INT_REG + 1;
       if ((indirect_thunks_used & (1 << i)))
        output_indirect_thunk_function (false, regno);