+2007-01-11 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/tree-ssa/tailrecursion-4.c: Update dump file.
+ * gcc.dg/tree-ssa/tailrecursion-1.c: Update dump file.
+ * gcc.dg/tree-ssa/tailrecursion-2.c: Update dump file.
+ * gcc.dg/tree-ssa/tailrecursion-3.c: Update dump file.
+ * gcc.dg/tree-ssa/pr21658.c: Likewise.
+ * gcc.dg/tree-ssa/pr15349.c: Likewise.
+ * gcc.dg/tree-ssa/pr25501.c: Likewise.
+ * gcc.dg/tree-ssa/vrp11.c: Make more complex so it still test
+ transformation in question.
+ * gcc.dg/tree-ssa/vrp05.c: Likewise.
+ * gcc.dg/tree-ssa/pr20701.c: Likewise.
+ * gcc.dg/always_inline3.c: Likewise.
+
2007-01-10 Mark Mitchell <mark@codesourcery.com>
PR c++/28999
/* { dg-do compile } */
/* { dg-options "-Winline -O2" } */
+void do_something_evil (void);
inline __attribute__ ((always_inline)) void
q2(void)
{ /* { dg-error "recursive" "" } */
+ do_something_evil ();
q2(); /* { dg-error "called from here" "" } */
q2(); /* { dg-error "called from here" "" } */
}
return t;
}
-/* { dg-final { scan-tree-dump-times "PHI" 1 "mergephi"} } */
-/* { dg-final { cleanup-tree-dump "mergephi" } } */
+/* { dg-final { scan-tree-dump-times "PHI" 1 "mergephi2"} } */
+/* { dg-final { cleanup-tree-dump "mergephi2" } } */
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-O2 -fdump-tree-vrp2 -fno-early-inlining" } */
typedef struct {
int code;
} *rtx;
+static inline void *zero ()
+{
+ return 0;
+}
+static inline int three ()
+{
+ return 3;
+}
+
int
can_combine_p (rtx insn, rtx elt)
{
rtx set;
- set = 0;
- if (insn->code == 3)
+ set = zero ();
+ if (insn->code == three ())
set = insn;
else
{
set = elt;
- if (set == 0)
+ if (set == zero ())
return 0;
}
- if (set == 0)
+ if (set == zero ())
return 1;
return 0;
}
-/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp1" } } */
-/* { dg-final { cleanup-tree-dump "vrp1" } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp2" } } */
+/* { dg-final { cleanup-tree-dump "vrp2" } } */
link_error ();
}
-/* { dg-final { scan-tree-dump-times "Folded statement: if " 1 "ccp"} } */
-/* { dg-final { cleanup-tree-dump "ccp" } } */
+/* { dg-final { scan-tree-dump-times "Folded statement: if " 1 "ccp1"} } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
return 13;
}
-/* { dg-final { scan-tree-dump-times "Removing basic block" 0 "mergephi"} } */
+/* { dg-final { scan-tree-dump-times "Removing basic block" 0 "mergephi1"} } */
/* { dg-final { cleanup-tree-dump "mergephi" } } */
else
return 0;
}
-/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr"} } */
-/* { dg-final { cleanup-tree-dump "tailr" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
else
return 0;
}
-/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr"} } */
-/* { dg-final { cleanup-tree-dump "tailr" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
r=r;
return r;
}
-/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr"} } */
-/* { dg-final { cleanup-tree-dump "tailr" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
r=r;
return r;
}
-/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 2 "tailr"} } */
-/* { dg-final { cleanup-tree-dump "tailr" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 2 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-O2 -fdump-tree-vrp1 -fno-early-inlining" } */
+
+
+inline int ten()
+{
+ return 10;
+}
+inline int zero()
+{
+ return 0;
+}
foo (int k, int j)
{
- if (k >= 10)
+ if (k >= ten())
{
if (j > k)
{
/* We should fold this to if (1). */
- if (j > 0)
+ if (j > zero())
return j;
}
}
- return j;
+ return j+1;
}
/* { dg-final { scan-tree-dump-times "Folding predicate j_.*to 1" 1 "vrp1" } } */
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-O2 -fdump-tree-vrp1 -fno-early-inlining" } */
+
+int
+bounce (int arg)
+{
+ return arg;
+}
foo (int k, int j, int z)
{
if (j > k)
{
/* We should fold this to if (1). */
- if (j > z)
+ if (j > bounce (z))
return j;
}
}
- return j;
+ return j+1;
}
-/* { dg-final { scan-tree-dump-times "Folding predicate.*to 1" 1 "vrp1" } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 1" 1 "vrp2" } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */