aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 86ad2cb..c2884a6 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2973,6 +2973,11 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
|| TREE_TYPE (arg1) == error_mark_node)
return 0;
+ /* Similar, if either does not have a type (like a template id),
+ they aren't equal. */
+ if (!TREE_TYPE (arg0) || !TREE_TYPE (arg1))
+ return 0;
+
/* We cannot consider pointers to different address space equal. */
if (POINTER_TYPE_P (TREE_TYPE (arg0))
&& POINTER_TYPE_P (TREE_TYPE (arg1))