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
This commit is contained in:
parent
cff1a1225d
commit
9616781de2
4 changed files with 25 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
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>
|
||||
|
||||
|
|
|
@ -10604,6 +10604,9 @@ maybe_emit_sprintf_chk_warning (tree exp, enum built_in_function fcode)
|
|||
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);
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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
|
||||
|
|
11
gcc/testsuite/gcc.dg/pr89590.c
Normal file
11
gcc/testsuite/gcc.dg/pr89590.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
/* PR middle-end/89590 */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -Wall -w" } */
|
||||
|
||||
void free (void *);
|
||||
|
||||
void
|
||||
foo (void)
|
||||
{
|
||||
((void (*)()) free) ();
|
||||
}
|
Loading…
Add table
Reference in a new issue