diff options
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 57a7248..5a65586 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2497,6 +2497,11 @@ operand_equal_p (tree arg0, tree arg1, unsigned int flags) if (TYPE_UNSIGNED (TREE_TYPE (arg0)) != TYPE_UNSIGNED (TREE_TYPE (arg1))) return 0; + /* If both types don't have the same precision, then it is not safe + to strip NOPs. */ + if (TYPE_PRECISION (TREE_TYPE (arg0)) != TYPE_PRECISION (TREE_TYPE (arg1))) + return 0; + STRIP_NOPS (arg0); STRIP_NOPS (arg1); |