aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/pr33619.c45
-rw-r--r--gcc/tree-ssa-ter.c9
4 files changed, 59 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 682ce3d..7fc0386 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,12 @@
+2007-10-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/33619
+ * tree-ssa-ter.c (is_replaceable_p): Return false for all
+ calls.
+
2007-10-15 David Edelsohn <edelsohn@gnu.org>
- * config.gcc (powerpc-ibm-aix5*): Install altivec.h
+ * config.gcc (powerpc-ibm-aix5*): Install altivec.h.
2007-10-15 Richard Guenther <rguenther@suse.de>
@@ -12,7 +18,6 @@
2007-10-15 Maxim Kuvyrkov <maxim@codesourcery.com>
PR target/33133
-
* haifa-sched.c (process_insn_forw_deps_be_in_spec): Check if
speculation type of insn can be changed before trying to do that.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f74a14a..c541b3c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-10-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/33619
+ * gcc.dg/pr33619.c: New test.
+
2007-10-15 David Edelsohn <edelsohn@gnu.org>
lib/target-supports.exp (check_vmx_hw_available): Add -maltivec
@@ -13,7 +18,6 @@
2007-10-15 Maxim Kuvyrkov <maxim@codesourcery.com>
PR target/33133
-
* gcc.c-torture/compile/pr33133.c: New test.
2007-10-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
diff --git a/gcc/testsuite/gcc.dg/pr33619.c b/gcc/testsuite/gcc.dg/pr33619.c
new file mode 100644
index 0000000..8011e69
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr33619.c
@@ -0,0 +1,45 @@
+/* PR tree-optimization/33619 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#ifdef __powerpc__
+# define REG1 __asm__ ("3")
+# define REG2 __asm__ ("4")
+#elif defined __x86_64__
+# define REG1 __asm__ ("rdi")
+# define REG2 __asm__ ("rsi")
+#else
+# define REG1
+# define REG2
+#endif
+
+static inline void
+bar (unsigned long x, int y)
+{
+ register unsigned long p1 REG1 = x;
+ register unsigned long p2 REG2 = y;
+ __asm__ volatile ("" : "=r" (p1), "=r" (p2) : "0" (p1), "1" (p2) : "memory");
+ if (p1 != 0xdeadUL || p2 != 0xbefUL)
+ __builtin_abort ();
+}
+
+__attribute__((const, noinline)) int
+baz (int x)
+{
+ return x;
+}
+
+__attribute__((noinline)) void
+foo (unsigned long *x, int y)
+{
+ unsigned long a = *x;
+ bar (a, baz (y));
+}
+
+int
+main (void)
+{
+ unsigned long a = 0xdeadUL;
+ foo (&a, 0xbefUL);
+ return 0;
+}
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c
index 424ccbe..d8553ce 100644
--- a/gcc/tree-ssa-ter.c
+++ b/gcc/tree-ssa-ter.c
@@ -402,14 +402,9 @@ is_replaceable_p (tree stmt)
&& DECL_HARD_REGISTER (GENERIC_TREE_OPERAND (stmt, 1)))
return false;
- /* Calls to functions with side-effects cannot be replaced. */
+ /* No function calls can be replaced. */
if ((call_expr = get_call_expr_in (stmt)) != NULL_TREE)
- {
- int call_flags = call_expr_flags (call_expr);
- if (TREE_SIDE_EFFECTS (call_expr)
- && !(call_flags & (ECF_PURE | ECF_CONST | ECF_NORETURN)))
- return false;
- }
+ return false;
/* Leave any stmt with volatile operands alone as well. */
if (stmt_ann (stmt)->has_volatile_ops)