re PR c/35436 (ICE with attribute "format")

PR c/35436
	* c-format.c (init_dynamic_gfc_info): Ignore invalid locus type.

	* gcc.dg/format/gcc_gfc-2.c: New test.

From-SVN: r133800
This commit is contained in:
Volker Reichelt 2008-04-01 20:33:37 +00:00
parent 9e9b53411e
commit dc197ab91c
4 changed files with 26 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2008-04-01 Volker Reichelt <v.reichelt@netcologne.de>
PR c/35436
* c-format.c (init_dynamic_gfc_info): Ignore invalid locus type.
2008-04-02 Ben Elliston <bje@au.ibm.com>
* config/v850/v850.md (casesi): Remove if (0) code.

View file

@ -2474,7 +2474,8 @@ init_dynamic_gfc_info (void)
locus = identifier_global_value (locus);
if (locus)
{
if (TREE_CODE (locus) != TYPE_DECL)
if (TREE_CODE (locus) != TYPE_DECL
|| TREE_TYPE (locus) == error_mark_node)
{
error ("%<locus%> is not defined as a type");
locus = 0;

View file

@ -1,6 +1,11 @@
2008-04-01 Volker Reichelt <v.reichelt@netcologne.de>
PR c/35436
* gcc.dg/format/gcc_gfc-2.c: New test.
2008-03-31 Seongbae Park <seongbae.park@gmail.com>
* g++.db/bprob/bprob.exp: Do not check gcno files.
* g++.dg/bprob/bprob.exp: Do not check gcno files.
Use -fprofile-use for profile use.
* gcc.misc-tests/bprob.exp: Ditto.
* g++.dg/tree-pro/tree-prof.exp: Do not check gcno files.

View file

@ -0,0 +1,13 @@
/* PR c/35436 */
/* { dg-do compile } */
/* { dg-options "-Wformat" } */
typedef void locus[1]; /* { dg-error "array of void" } */
void foo(const char*, ...)
__attribute__((__format__(__gcc_gfc__, 1, 2))); /* { dg-error "locus" } */
void bar()
{
foo("%L", 0); /* { dg-warning "format" } */
}