Commit 1544db9a by Bernd Edlinger Committed by Bernd Edlinger

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
parent a353fec4
2018-07-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c/86617
* genmatch.c (dt_operand::gen_match_op): Avoid folding volatile values.
2018-07-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
* gimple-fold.c (gimple_fold_builtin_printf): Don't create a not NUL
terminated STRING_CST object.
......
......@@ -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;
......
2018-07-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c/86617
* gcc.dg/pr86617.c: New test.
2018-07-23 Jakub Jelinek <jakub@redhat.com>
PR c++/86569
......
/* { dg-options "-Os -fdump-rtl-final" } */
volatile unsigned char u8;
void test (void)
{
u8 = u8 + u8;
u8 = u8 - u8;
}
/* { dg-final { scan-rtl-dump-times "mem/v" 6 "final" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment