Commit 9616781d by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/89590 (ICE in maybe_emit_free_warning)

	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
parent cff1a122
2019-03-05 Jakub Jelinek <jakub@redhat.com> 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> Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/89570 PR tree-optimization/89570
......
...@@ -10604,6 +10604,9 @@ maybe_emit_sprintf_chk_warning (tree exp, enum built_in_function fcode) ...@@ -10604,6 +10604,9 @@ maybe_emit_sprintf_chk_warning (tree exp, enum built_in_function fcode)
static void static void
maybe_emit_free_warning (tree exp) maybe_emit_free_warning (tree exp)
{ {
if (call_expr_nargs (exp) != 1)
return;
tree arg = CALL_EXPR_ARG (exp, 0); tree arg = CALL_EXPR_ARG (exp, 0);
STRIP_NOPS (arg); 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> 2019-03-05 Wilco Dijkstra <wdijkstr@arm.com>
PR target/89222 PR target/89222
......
/* PR middle-end/89590 */
/* { dg-do compile } */
/* { dg-options "-O2 -Wall -w" } */
void free (void *);
void
foo (void)
{
((void (*)()) free) ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment