Commit 10fa8dfb by Marek Polacek Committed by Marek Polacek

re PR c/79730 (ICE tree check: expected var_decl, have function_decl in…

re PR c/79730 (ICE tree check: expected var_decl, have function_decl in finish_decl, at c/c-decl.c:5063)

	PR c/79730
	* c-decl.c (finish_decl): Check VAR_P.

	* gcc.dg/pr79730.c: New test.

From-SVN: r246578
parent fdc54f39
2017-03-29 Marek Polacek <polacek@redhat.com>
PR c/79730
* c-decl.c (finish_decl): Check VAR_P.
2017-03-27 Jakub Jelinek <jakub@redhat.com> 2017-03-27 Jakub Jelinek <jakub@redhat.com>
PR middle-end/80162 PR middle-end/80162
......
...@@ -5066,7 +5066,7 @@ finish_decl (tree decl, location_t init_loc, tree init, ...@@ -5066,7 +5066,7 @@ finish_decl (tree decl, location_t init_loc, tree init,
when a tentative file-scope definition is seen. when a tentative file-scope definition is seen.
But at end of compilation, do output code for them. */ But at end of compilation, do output code for them. */
DECL_DEFER_OUTPUT (decl) = 1; DECL_DEFER_OUTPUT (decl) = 1;
if (asmspec && C_DECL_REGISTER (decl)) if (asmspec && VAR_P (decl) && C_DECL_REGISTER (decl))
DECL_HARD_REGISTER (decl) = 1; DECL_HARD_REGISTER (decl) = 1;
rest_of_decl_compilation (decl, true, 0); rest_of_decl_compilation (decl, true, 0);
} }
......
2017-03-29 Marek Polacek <polacek@redhat.com>
PR c/79730
* gcc.dg/pr79730.c: New test.
2017-03-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2017-03-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/78670 PR libgfortran/78670
......
/* PR c/79730 */
/* { dg-do compile } */
/* { dg-options "-std=gnu11" } */
register int x() asm (""); /* { dg-error "invalid storage class" } */
register float y() asm (""); /* { dg-error "invalid storage class" } */
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