re PR tree-optimization/54494 (Missing store to volatile)

2012-09-06  Andrew Pinski  <apinski@cavium.com>

        PR tree-opt/54494
        * tree-inline.c (remap_gimple_op_r): Copy TREE_SIDE_EFFECTS also.
2012-09-06  Andrew Pinski  <apinski@cavium.com>

        PR tree-opt/54494
        * gcc.dg/tree-ssa/strlen-1.c: New testcase.

From-SVN: r191025
This commit is contained in:
Andrew Pinski 2012-09-06 13:51:37 +00:00 committed by Andrew Pinski
parent c2dcf8a007
commit 832314ef29
4 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2012-09-06 Andrew Pinski <apinski@cavium.com>
PR tree-opt/54494
* tree-inline.c (remap_gimple_op_r): Copy TREE_SIDE_EFFECTS also.
2012-09-05 Jakub Jelinek <jakub@redhat.com>
PR middle-end/54486

View File

@ -1,3 +1,8 @@
2012-09-06 Andrew Pinski <apinski@cavium.com>
PR tree-opt/54494
* gcc.dg/tree-ssa/strlen-1.c: New testcase.
2012-09-05 Jakub Jelinek <jakub@redhat.com>
PR middle-end/54486

View File

@ -0,0 +1,17 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
extern const unsigned long base;
static inline void wreg(unsigned char val, unsigned long addr) __attribute__((always_inline));
static inline void wreg(unsigned char val, unsigned long addr)
{
*((volatile unsigned char *) (__SIZE_TYPE__) (base + addr)) = val;
}
void wreg_twice(void)
{
wreg(0, 42);
wreg(0, 42);
}
/* We should not remove the second null character store to (base+42) address. */
/* { dg-final { scan-tree-dump-times " ={v} 0;" 2 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */

View File

@ -871,6 +871,7 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
ptr, TREE_OPERAND (*tp, 1));
TREE_THIS_NOTRAP (*tp) = TREE_THIS_NOTRAP (old);
TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
TREE_SIDE_EFFECTS (*tp) = TREE_SIDE_EFFECTS (old);
TREE_NO_WARNING (*tp) = TREE_NO_WARNING (old);
*walk_subtrees = 0;
return NULL;