PR middle-end/89590
* builtins.c (maybe_emit_free_warning): Punt if free doesn't have
exactly one argument.
* gcc.dg/pr89590.c: New test.
From-SVN: r269392
+2019-03-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/89590
+ * builtins.c (maybe_emit_free_warning): Punt if free doesn't have
+ exactly one argument.
+
2019-03-05 Jakub Jelinek <jakub@redhat.com>
Richard Sandiford <richard.sandiford@arm.com>
static void
maybe_emit_free_warning (tree exp)
{
+ if (call_expr_nargs (exp) != 1)
+ return;
+
tree arg = CALL_EXPR_ARG (exp, 0);
STRIP_NOPS (arg);
+2019-03-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/89590
+ * gcc.dg/pr89590.c: New test.
+
2019-03-05 Wilco Dijkstra <wdijkstr@arm.com>
PR target/89222
--- /dev/null
+/* PR middle-end/89590 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -w" } */
+
+void free (void *);
+
+void
+foo (void)
+{
+ ((void (*)()) free) ();
+}