summaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorbergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-11 11:51:50 +0000
committerbergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-11 11:51:50 +0000
commit0a98b6d91809680c2b3201568beb8aeb00e5ed76 (patch)
tree6e7eefc3eddd1af4ac56297fa67f1bdc9071dae9 /gcc/rtlanal.c
parent51bc6b40dfbccc941dc5dd36608b84e6460ef8b6 (diff)
downloadgcc-0a98b6d91809680c2b3201568beb8aeb00e5ed76.tar.gz
gcc/
PR target/16458 * rtlanal.c (unsigned_reg_p): New function. Update copyright notice dates. * rtl.h (unsigned_reg_p): Prototype it. Update copyright notice dates. * config/rs6000/rs6000.c (rs6000_generate_compare): Use it. Update comment. * expr.c (expand_expr_real_1): Set register attributes. * stmt.c (expand_case): Likewise. gcc/testsuite/ PR target/16458 * gcc.target/powerpc/pr16458-1.c: New test. * gcc.target/powerpc/pr16458-2.c: Likewise. * gcc.target/powerpc/pr16458-3.c: Likewise. * gcc.target/powerpc/pr16458-4.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186312 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 7c4a49bef09..858264b7a03 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1,7 +1,7 @@
/* Analyze RTL for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
- 2011 Free Software Foundation, Inc.
+ 2011, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -636,6 +636,25 @@ count_occurrences (const_rtx x, const_rtx find, int count_dest)
}
+/* Return TRUE if OP is a register or subreg of a register that
+ holds an unsigned quantity. Otherwise, return FALSE. */
+
+bool
+unsigned_reg_p (rtx op)
+{
+ if (REG_P (op)
+ && REG_EXPR (op)
+ && TYPE_UNSIGNED (TREE_TYPE (REG_EXPR (op))))
+ return true;
+
+ if (GET_CODE (op) == SUBREG
+ && SUBREG_PROMOTED_UNSIGNED_P (op))
+ return true;
+
+ return false;
+}
+
+
/* Nonzero if register REG appears somewhere within IN.
Also works if REG is not a register; in this case it checks
for a subexpression of IN that is Lisp "equal" to REG. */