builtins.c (expand_builtin_nonlocal_goto): Avoid evaluating PIC_OFFSET_TABLE_REGNUM...
authorAldy Hernandez <aldyh@redhat.com>
Thu, 27 Oct 2016 16:13:19 +0000 (16:13 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Thu, 27 Oct 2016 16:13:19 +0000 (16:13 +0000)
* builtins.c (expand_builtin_nonlocal_goto): Avoid evaluating
PIC_OFFSET_TABLE_REGNUM twice.

From-SVN: r241625

gcc/ChangeLog
gcc/builtins.c

index 73d3004b7cdd394aed50a40c8f03efa91c5bf411..ce103ab4a9d5439518d5b28a3106de85443f5a13 100644 (file)
@@ -1,3 +1,8 @@
+2016-10-27  Aldy Hernandez  <aldyh@redhat.com>
+
+       * builtins.c (expand_builtin_nonlocal_goto): Avoid evaluating
+       PIC_OFFSET_TABLE_REGNUM twice.
+
 2016-10-27  Bin Cheng  <bin.cheng@arm.com>
 
        * match.pd ((convert (op:s (convert@2 @0) (convert?@3 @1)))): Add
index 997c0e8c1cbe00e7853b06809a2a50cd29b638fa..cc711a0f8430de41f77d1ff2b10abc9560a1025a 100644 (file)
@@ -1140,8 +1140,8 @@ expand_builtin_nonlocal_goto (tree exp)
         to targets with a nonlocal_goto pattern; they are free
         to implement it in their own way.  Note also that this is
         a no-op if the GP register is a global invariant.)  */
-      if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
-         && fixed_regs[PIC_OFFSET_TABLE_REGNUM])
+      unsigned regnum = PIC_OFFSET_TABLE_REGNUM;
+      if (regnum != INVALID_REGNUM && fixed_regs[regnum])
        emit_use (pic_offset_table_rtx);
 
       emit_indirect_jump (r_label);