aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/strlen-1.c17
-rw-r--r--gcc/tree-inline.c1
4 files changed, 28 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ca50124..74ad7d2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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-06 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/54455
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8589e9e..56b6e0d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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-06 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/54455
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/strlen-1.c b/gcc/testsuite/gcc.dg/tree-ssa/strlen-1.c
new file mode 100644
index 0000000..f6ff3e1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/strlen-1.c
@@ -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" } } */
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 20d3317..05f271f 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -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;