Commit 31a47f1a by Andrew Pinski Committed by Andrew Pinski

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: r191014
parent 5ef5a3b7
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 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/54455
......
2012-09-06 Andrew Pinski <apinski@cavium.com>
PR tree-opt/54494
* gcc.dg/tree-ssa/strlen-1.c: New testcase.
2012-09-06 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/54455
......
/* { 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" } } */
......@@ -848,6 +848,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;
......
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