* predict.c (tree_estimate_probability): Check if last_stmt is
non-NULL before dereferencing it.
* gcc.dg/pr37879.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141390
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/37879
+ * predict.c (tree_estimate_probability): Check if last_stmt is
+ non-NULL before dereferencing it.
+
2008-10-27 Vladimir Makarov <vmakarov@redhat.com>
* ira-int.h (ira_allocno): Add member updated_cover_class_cost.
{
edge e;
edge_iterator ei;
+ gimple last;
FOR_EACH_EDGE (e, ei, bb->succs)
{
&& e->dest != EXIT_BLOCK_PTR
&& single_succ_p (e->dest)
&& single_succ_edge (e->dest)->dest == EXIT_BLOCK_PTR
- && gimple_code (last_stmt (e->dest)) == GIMPLE_RETURN)
+ && (last = last_stmt (e->dest)) != NULL
+ && gimple_code (last) == GIMPLE_RETURN)
{
edge e1;
edge_iterator ei1;
+2008-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/37879
+ * gcc.dg/pr37879.c: New test.
+
2008-10-24 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/37841
--- /dev/null
+/* PR tree-optimization/37879 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+static inline void bar (int) __attribute__ ((noreturn));
+void baz () __attribute__ ((noreturn));
+
+inline int
+foo (int i)
+{
+ return i;
+}
+
+int i = 23;
+static inline void
+bar (int j)
+{
+ if (j)
+ asm ("");
+} /* { dg-warning "does return" } */
+
+void
+baz ()
+{
+ int j;
+ bar (foo (j = i++));
+ asm ("");
+}