diff gcc/loop-invariant.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
line wrap: on
line diff
--- a/gcc/loop-invariant.c	Fri Oct 27 22:46:09 2017 +0900
+++ b/gcc/loop-invariant.c	Thu Oct 25 07:37:49 2018 +0900
@@ -1,5 +1,5 @@
 /* RTL-level loop invariant motion.
-   Copyright (C) 2004-2017 Free Software Foundation, Inc.
+   Copyright (C) 2004-2018 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -335,6 +335,8 @@
 	}
       else if (fmt[i] == 'i' || fmt[i] == 'n')
 	val ^= XINT (x, i);
+      else if (fmt[i] == 'p')
+	val ^= constant_lower_bound (SUBREG_BYTE (x));
     }
 
   return val;
@@ -420,6 +422,11 @@
 	  if (XINT (e1, i) != XINT (e2, i))
 	    return false;
 	}
+      else if (fmt[i] == 'p')
+	{
+	  if (maybe_ne (SUBREG_BYTE (e1), SUBREG_BYTE (e2)))
+	    return false;
+	}
       /* Unhandled type of subexpression, we fail conservatively.  */
       else
 	return false;
@@ -653,6 +660,9 @@
   return (GET_MODE (x) != VOIDmode
 	  && GET_MODE (x) != BLKmode
 	  && can_copy_p (GET_MODE (x))
+	  /* Do not mess with the frame pointer adjustments that can
+	     be generated e.g. by expand_builtin_setjmp_receiver.  */
+	  && x != frame_pointer_rtx
 	  && (!REG_P (x)
 	      || !HARD_REGISTER_P (x)
 	      || REGNO_REG_CLASS (REGNO (x)) != NO_REGS));