summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-14 01:59:16 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-14 01:59:16 +0000
commit7a24815fdca215d6cca24673785b89fb330d3b8f (patch)
tree1ed98236146ff8a31ea06a48829690af91367819
parent907f3f29b44e99d1379c2ab69ceedc49e8b0da16 (diff)
downloadppe42-gcc-7a24815fdca215d6cca24673785b89fb330d3b8f.tar.gz
ppe42-gcc-7a24815fdca215d6cca24673785b89fb330d3b8f.zip
* calls.c (flags_from_decl_or_type): Factor and remove redundant
conditional tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64347 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/calls.c17
2 files changed, 15 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0b3f89542b2..5e7a19bf440 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-03-13 Roger Sayle <roger@eyesopen.com>
+
+ * calls.c (flags_from_decl_or_type): Factor and remove redundant
+ conditional tests.
+
2003-03-13 Mike Stump <mrs@apple.com>
* ggc-page.c (struct page_entry): Remove varray.h header.
diff --git a/gcc/calls.c b/gcc/calls.c
index cab6571f328..f23b9397d59 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -796,23 +796,26 @@ flags_from_decl_or_type (exp)
{
int flags = 0;
tree type = exp;
- /* ??? We can't set IS_MALLOC for function types? */
+
if (DECL_P (exp))
{
struct cgraph_rtl_info *i = cgraph_rtl_info (exp);
type = TREE_TYPE (exp);
- if (i && i->pure_function)
- flags |= ECF_PURE | ECF_LIBCALL_BLOCK;
- if (i && i->const_function)
- flags |= ECF_CONST | ECF_LIBCALL_BLOCK;
+ if (i)
+ {
+ if (i->pure_function)
+ flags |= ECF_PURE | ECF_LIBCALL_BLOCK;
+ if (i->const_function)
+ flags |= ECF_CONST | ECF_LIBCALL_BLOCK;
+ }
/* The function exp may have the `malloc' attribute. */
- if (DECL_P (exp) && DECL_IS_MALLOC (exp))
+ if (DECL_IS_MALLOC (exp))
flags |= ECF_MALLOC;
/* The function exp may have the `pure' attribute. */
- if (DECL_P (exp) && DECL_IS_PURE (exp))
+ if (DECL_IS_PURE (exp))
flags |= ECF_PURE | ECF_LIBCALL_BLOCK;
if (TREE_NOTHROW (exp))
OpenPOWER on IntegriCloud