+2018-03-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/84739
+ * tree-tailcall.c (find_tail_calls): Check call arguments against
+ DECL_ARGUMENTS (current_function_decl) rather than
+ DECL_ARGUMENTS (func) when checking for tail recursion.
+
2018-03-07 Jakub Jelinek <jakub@redhat.com>
* doc/contrib.texi: Add entries for Martin Liska, David Malcolm,
+2018-03-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/84739
+ * gcc.dg/pr84739.c: New test.
+
2018-03-07 Martin Sebor <msebor@redhat.com>
PR tree-optimization/83519
--- /dev/null
+/* PR tree-optimization/84739 */
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-options "-O2" } */
+
+static void baz (void) __attribute__((weakref("bar"))); /* { dg-warning "alias between functions of incompatible types" } */
+
+int
+foo (int x, int y)
+{
+ if (x)
+ y = 0;
+ if (y)
+ goto lab;
+ y = 0;
+lab:
+ return y;
+}
+
+void
+bar (int x, int y) /* { dg-message "aliased declaration here" } */
+{
+ y = foo (x, y);
+ if (y != 0)
+ baz ();
+}
{
tree arg;
- for (param = DECL_ARGUMENTS (func), idx = 0;
+ for (param = DECL_ARGUMENTS (current_function_decl), idx = 0;
param && idx < gimple_call_num_args (call);
param = DECL_CHAIN (param), idx ++)
{