aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2013-12-13 17:50:18 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2013-12-13 17:50:18 +0000
commit17fc8d6f0e361e17b6994e26859b075c527d00fc (patch)
treebe2141f867bda3e7120ff6fe1a389f08afe0be32
parent1904eff11378de2472c6e5560470bda08216f57e (diff)
downloadgcc-17fc8d6f0e361e17b6994e26859b075c527d00fc.zip
gcc-17fc8d6f0e361e17b6994e26859b075c527d00fc.tar.gz
gcc-17fc8d6f0e361e17b6994e26859b075c527d00fc.tar.bz2
re PR tree-optimization/59149 (diagnose_tm_1 calls flags_from_decl_or_type on an ADDR_EXPR)
PR tree-optimization/59149 * calls.c (flags_from_decl_or_type): Fail on non decl or type. * trans-mem.c (diagnose_tm_1): Do not call flags_from_decl_or_type if no type or decl. From-SVN: r205967
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/calls.c2
-rw-r--r--gcc/trans-mem.c3
3 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a238cac..9aeeadb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2013-12-13 Aldy Hernandez <aldyh@redhat.com>
+
+ PR tree-optimization/59149
+ * calls.c (flags_from_decl_or_type): Fail on non decl or type.
+ * trans-mem.c (diagnose_tm_1): Do not call flags_from_decl_or_type
+ if no type or decl.
+
2013-12-13 Kenneth Zadeck <zadeck@naturalbridge.com>
* config/arc/arc.h (BITS_PER_UNIT): Removed.
diff --git a/gcc/calls.c b/gcc/calls.c
index 3963bc2..2226e78 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -769,6 +769,8 @@ flags_from_decl_or_type (const_tree exp)
|| lookup_attribute ("transaction_pure", TYPE_ATTRIBUTES (exp))))
flags |= ECF_TM_PURE;
}
+ else
+ gcc_unreachable ();
if (TREE_THIS_VOLATILE (exp))
{
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index c9af680..ba34488 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -677,7 +677,8 @@ diagnose_tm_1 (gimple_stmt_iterator *gsi, bool *handled_ops_p,
}
else if (direct_call_p)
{
- if (flags_from_decl_or_type (fn) & ECF_TM_BUILTIN)
+ if (IS_TYPE_OR_DECL_P (fn)
+ && flags_from_decl_or_type (fn) & ECF_TM_BUILTIN)
is_safe = true;
else if (replacement)
{