diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2018-07-23 13:23:51 +0000 |
---|---|---|
committer | Bernd Edlinger <edlinger@gcc.gnu.org> | 2018-07-23 13:23:51 +0000 |
commit | 1544db9a61b6a441be68c5a6ba2504a6ccc2b956 (patch) | |
tree | 9e2db6ef58a14073413f15b8f6c894ed5815d787 /gcc/genmatch.c | |
parent | a353fec45af2c09f8e3c849ac8f00e7342600019 (diff) | |
download | gcc-1544db9a61b6a441be68c5a6ba2504a6ccc2b956.zip gcc-1544db9a61b6a441be68c5a6ba2504a6ccc2b956.tar.gz gcc-1544db9a61b6a441be68c5a6ba2504a6ccc2b956.tar.bz2 |
re PR c/86617 (Volatile qualifier is ignored sometimes for unsigned char)
gcc:
2018-07-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c/86617
* genmatch.c (dt_operand::gen_match_op): Avoid folding volatile values.
testsuite:
2018-07-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c/86617
* gcc.dg/pr86617.c: New test.
From-SVN: r262933
Diffstat (limited to 'gcc/genmatch.c')
-rw-r--r-- | gcc/genmatch.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/genmatch.c b/gcc/genmatch.c index 5d6cf0b..5848722 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -2748,12 +2748,14 @@ dt_operand::gen_match_op (FILE *f, int indent, const char *opname, bool) char match_opname[20]; match_dop->get_name (match_opname); if (value_match) - fprintf_indent (f, indent, "if (%s == %s || operand_equal_p (%s, %s, 0))\n", - opname, match_opname, opname, match_opname); + fprintf_indent (f, indent, "if ((%s == %s && ! TREE_SIDE_EFFECTS (%s)) " + "|| operand_equal_p (%s, %s, 0))\n", + opname, match_opname, opname, opname, match_opname); else - fprintf_indent (f, indent, "if (%s == %s || (operand_equal_p (%s, %s, 0) " + fprintf_indent (f, indent, "if ((%s == %s && ! TREE_SIDE_EFFECTS (%s)) " + "|| (operand_equal_p (%s, %s, 0) " "&& types_match (%s, %s)))\n", - opname, match_opname, opname, match_opname, + opname, match_opname, opname, opname, match_opname, opname, match_opname); fprintf_indent (f, indent + 2, "{\n"); return 1; |