Missing declaration causes ICE or segmentation fault

John David Anglin dave@hiauly1.hia.nrc.ca
Thu Jun 22 13:59:00 GMT 2000


> On Fri, Jun 16, 2000 at 04:12:43PM -0400, John David Anglin wrote:
> > it is clear that the problem occurs because digest_init was called with
> > TREE_TYPE (init) == error_mark_node.  This suggests that TREE_TYPE (init)
> > should also be tested to see if it is an error_mark_node, in addition
> > to type and init.
> 
> I don't think we should have created `init' with type error_mark_node.
> At first blush it would seem more correct to have decayed init itself
> to error_mark_node earlier.

While the correct approach may be to decay init, how to do this is not
obvious to me.  I have now completed a complete bootstrap for vax-dec-ultrix4.3
with the appended patches installed.

The c-typeck.c patch corrects the above abort and produced a reasonable
set of error messages from the test case.

The reload.c patch corrects the reload abort for code similar to

f ((int)a < (int)b);

The abort is due to find_reloads generating an input reload for non
offsettable memory reference.  In the above, the result of the comparison
needs to be pushed to the stack for the function call.  While there may
be more elaborate means to resolve the problem, the patch seems to do the job
on the vax.

Please review.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2000-06-16  J. David Anglin  <dave@hiauly1.hia.nrc.ca>

	* c-typeck.c (digest_init): Return error_mark_node node when
	TREE_TYPE (init)  == error_mark_node.

--- c-typeck.c.orig	Fri Jun  9 18:33:51 2000
+++ c-typeck.c	Fri Jun 16 15:04:11 2000
@@ -4518,7 +4518,9 @@
   enum tree_code code = TREE_CODE (type);
   tree inside_init = init;
 
-  if (type == error_mark_node || init == error_mark_node)
+  if (type == error_mark_node
+      || init == error_mark_node
+      || TREE_TYPE (init)  == error_mark_node)
     return error_mark_node;
 
   /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue.  */
2000-06-15  J. David Anglin  <dave@hiauly1.hia.nrc.ca>

	* reload.c (find_reloads): Don't reload a nonoffsettable memory address
	into an offsettable base register when no_input_reloads is true.

--- reload.c.orig	Thu Jun  1 10:50:59 2000
+++ reload.c	Wed Jun 14 20:20:03 2000
@@ -3560,7 +3560,8 @@
 	   so we don't bother with it.  It may not be worth doing.  */
 	else if (goal_alternative_matched[i] == -1
 		 && goal_alternative_offmemok[i]
-		 && GET_CODE (recog_data.operand[i]) == MEM)
+		 && GET_CODE (recog_data.operand[i]) == MEM
+		 && !no_input_reloads)
 	  {
 	    operand_reloadnum[i]
 	      = push_reload (XEXP (recog_data.operand[i], 0), NULL_RTX,


More information about the Gcc-patches mailing list