public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/9163] [3.3/3.4 regression] ICE in genrtl_compound_stmt at c-semantics.c:776 with c99 mode and checking enabled
Date: Mon, 22 Dec 2003 16:24:00 -0000	[thread overview]
Message-ID: <20031222160729.16239.qmail@sources.redhat.com> (raw)
In-Reply-To: <20030103150600.9163.ehrhardt@mathematik.uni-ulm.de>


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-22 16:07 -------
Since my email has not come through yet (why?):
ChangeLog:

	* c-decl.c (poplevel): Only set DECL_INITIAL of a current function
	if it is non-null.
	(finish_function): Check for error_mark_node on DECL_RESULT and DECL_RESULT
	of fndecl.
	(c_expand_body): Only expand when DECL_INITIAL of fndecl is not
	error_mark_node.


Patch:
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.462
diff -u -p -r1.462 c-decl.c
--- c-decl.c	21 Dec 2003 14:08:32 -0000	1.462
+++ c-decl.c	22 Dec 2003 06:04:20 -0000
@@ -676,7 +676,7 @@ poplevel (int keep, int dummy ATTRIBUTE_
     IDENTIFIER_TAG_VALUE (TREE_PURPOSE (p)) = TREE_VALUE (p);

   /* Dispose of the block that we just made inside some higher level.  */
-  if (scope->function_body)
+  if (scope->function_body && current_function_decl)
     DECL_INITIAL (current_function_decl) = block;
   else if (scope->outer)
     {
@@ -6088,11 +6088,13 @@ finish_function (void)
  	}
     }

-  BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
+  if (DECL_INITIAL (fndecl) != error_mark_node)
+    BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;

   /* Must mark the RESULT_DECL as being in this function.  */

-  DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl;
+  if (DECL_RESULT (fndecl) != error_mark_node)
+    DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl;

   if (MAIN_NAME_P (DECL_NAME (fndecl)) && flag_hosted)
     {
@@ -6223,7 +6225,9 @@ c_expand_body_1 (tree fndecl, int nested
 void
 c_expand_body (tree fndecl)
 {
-  c_expand_body_1 (fndecl, 0);
+
+  if (DECL_INITIAL (fndecl) != error_mark_node)
+    c_expand_body_1 (fndecl, 0);
 }
 
\f
 /* Check the declarations given in a for-loop for satisfying the C99


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9163


  parent reply	other threads:[~2003-12-22 16:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030103150600.9163.ehrhardt@mathematik.uni-ulm.de>
2003-06-11 22:14 ` pinskia@physics.uc.edu
2003-06-22  1:39 ` pinskia at physics dot uc dot edu
2003-07-23 19:51 ` pinskia at physics dot uc dot edu
2003-08-03 17:07 ` pinskia at physics dot uc dot edu
2003-09-17  6:07 ` pinskia at gcc dot gnu dot org
2003-10-24 17:49 ` dhazeghi at yahoo dot com
2003-12-22  8:18 ` pinskia at gcc dot gnu dot org
2003-12-22 16:24 ` pinskia at gcc dot gnu dot org [this message]
2003-12-22 16:36 ` pinskia at gcc dot gnu dot org
2003-12-22 18:32 ` cvs-commit at gcc dot gnu dot org
2003-12-22 18:51 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031222160729.16239.qmail@sources.redhat.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).