This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcc patch to fix -fsyntax-only (again)


(Jeff Law, could you install this patch for me please, after reviewing
it for sanity?)

This patch fixes a crash that recently showed up when using g77
to compile an old test case with `-W -Wall -fsyntax-only'.  Just
happened to be that old garbage finally was ugly enough to cause
a segv, I guess.  The bug was introduced by myself in an earlier
patch to make -fsyntax-only not crash in other situations.

        tq vm, (burley)


Sat Jul 11 19:13:25 1998  Craig Burley  <burley@gnu.org>

	* stmt.c (expand_expr_stmt): If not assigning fresh
	value to last_expr_value, zero it, so old garbage
	doesn't get dereferenced.


*** g77-e/gcc/stmt.c.~1~	Mon Jul  6 06:42:42 1998
--- g77-e/gcc/stmt.c	Sat Jul 11 19:09:01 1998
*************** expand_expr_stmt (exp)
*** 1534,1538 ****
  
    last_expr_type = TREE_TYPE (exp);
!   if (! flag_syntax_only || expr_stmts_for_value)
      last_expr_value = expand_expr (exp,
  				   (expr_stmts_for_value
--- 1534,1540 ----
  
    last_expr_type = TREE_TYPE (exp);
!   if (flag_syntax_only && ! expr_stmts_for_value)
!     last_expr_value = 0;
!   else
      last_expr_value = expand_expr (exp,
  				   (expr_stmts_for_value


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]