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]

g77 patch (g++ and other front end maintainers take note!)


(Dave Love, could you install this patch for me please?)

Aside from a one-liner, most of this patch remove the __eprintf
function from the g77 front end.  I believe all front ends should
do the same, because this function is provided in libgcc2.c.

As a result of making this fix, internal g77 crashes due to
triggering assert() calls have more sensible diagnostics.

Previously, they implied that the crash was within g77's
copy of __eprintf, since it calls abort().

So, if this patch is wrong, let me know and I'll revert it, but
we really should find a better solution than to have an identical
function in each front end, and solve the confusing diagnostic
problem some other way perhaps.

        tq vm, (burley)


Sat Jul 11 18:24:37 1998  Craig Burley  <burley@gnu.org>

	* com.c (ffecom_expr_) [FFEBLD_opCONTER]: Die if padding
	for constant is non-zero.

	* com.c (__eprintf): Delete this function, it is obsolete.

  
*** g77-e/gcc/f/com.c.~1~	Mon Jul  6 04:29:26 1998
--- g77-e/gcc/f/com.c	Fri Jul 10 06:53:49 1998
*************** ffecom_expr_ (ffebld expr, tree dest_tre
*** 2884,2887 ****
--- 2884,2888 ----
  
      case FFEBLD_opCONTER:
+       assert (ffebld_conter_pad (expr) == 0);
        item
  	= ffecom_constantunion (&ffebld_constant_union (ffebld_conter (expr)),
*************** start_function (tree name, tree type, in
*** 14823,14849 ****
  
  /* Here are the public functions the GNU back end needs.  */
- 
- /* This is used by the `assert' macro.  It is provided in libgcc.a,
-    which `cc' doesn't know how to link.  Note that the C++ front-end
-    no longer actually uses the `assert' macro (instead, it calls
-    my_friendly_assert).  But all of the back-end files still need this.  */
- void
- __eprintf (string, expression, line, filename)
- #ifdef __STDC__
-      const char *string;
-      const char *expression;
-      unsigned line;
-      const char *filename;
- #else
-      char *string;
-      char *expression;
-      unsigned line;
-      char *filename;
- #endif
- {
-   fprintf (stderr, string, expression, line, filename);
-   fflush (stderr);
-   abort ();
- }
  
  tree
--- 14824,14827 ----


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