public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Fergus Henderson <fjh@cs.mu.oz.au>
To: Peter Gerwinski <peter@gerwinski.de>
Cc: gcc@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: Different language frontends and fancy_abort()
Date: Mon, 01 Jan 2001 23:02:00 -0000	[thread overview]
Message-ID: <20010102180150.A2460@hg.cs.mu.oz.au> (raw)
In-Reply-To: <20010102034850.A10663@esmeralda.gerwinski.de>

On 02-Jan-2001, Peter Gerwinski <peter@gerwinski.de> wrote:
> when a bug in the Pascal frontend triggers `fancy_abort()', GCC says:
> 
>     filename.pas:1375: Internal compiler error in foo, at bar.c:34
>     Please submit a full bug report.
>      See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
> 
> I would prefer to have bug reports for the Pascal frontend directed
> to another address instead. A mechanism to modify that string would
> be nice here.

I agree.  I want this for the Mercury front-end too.

Here's a patch.

----------

2001-01-02  Fergus Henderson  <fjh@cs.mu.oz.au>
 
 	* diagnostic.c (lang_handle_ICE): New.
 	(finish_abort): Call it.
 	* diagnostic.h (lang_handle_ICE): Declare it.
 
Index: diagnostic.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/diagnostic.c,v
retrieving revision 1.44
diff -u -d -c -p -r1.44 diagnostic.c
*** diagnostic.c	2000/11/17 06:05:14	1.44
--- diagnostic.c	2001/01/02 06:57:53
*************** extern int errorcount;
*** 115,120 ****
--- 115,124 ----
  /* Front-end specific tree formatter, if non-NULL.  */
  printer_fn lang_printer = NULL;
  
+ /* Front-end specific internal compiler error handler, if non-NULL.  */
+ void (*lang_handle_ICE) PARAMS ((void)) = NULL;
+ 
+ 
  /* This must be large enough to hold any printed integer or
     floating-point value.  */
  static char digit_buffer[128];
*************** finish_abort ()
*** 1687,1692 ****
--- 1691,1698 ----
  {
    if (errorcount > 1 || sorrycount > 0)
      fprintf (stderr, "confused by earlier errors, bailing out\n");
+   else if (lang_handle_ICE)
+     (*lang_handle_ICE) ();
    else
      fprintf (stderr, "\
  Please submit a full bug report.\n\
Index: diagnostic.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/diagnostic.h,v
retrieving revision 1.18
diff -u -d -c -p -r1.18 diagnostic.h
*** diagnostic.h	2000/11/15 15:50:49	1.18
--- diagnostic.h	2001/01/02 06:57:53
*************** extern printer_fn lang_printer;
*** 156,161 ****
--- 156,167 ----
  extern diagnostic_starter_fn lang_diagnostic_starter;
  extern diagnostic_finalizer_fn lang_diagnostic_finalizer;
  
+ /* If non-NULL, this variable contains a function to call
+    after an internal compiler error is encountered.
+    Normally the function should print a message to instruct
+    users on how to report bugs.  */
+ extern void (*lang_handle_ICE) PARAMS ((void));
+ 
  extern int diagnostic_message_length_per_line;
  
  /* This output buffer is used by front-ends that directly output
-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: < http://www.cs.mu.oz.au/~fjh >  |     -- the last words of T. S. Garp.

  reply	other threads:[~2001-01-01 23:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-01 18:49 Peter Gerwinski
2001-01-01 23:02 ` Fergus Henderson [this message]
2001-01-02  3:02 ` Trevor Jenkins
2001-01-02 10:34 ` Joseph S. Myers
2001-01-02  2:07 Richard Kenner
2001-01-02  3:11 ` Fergus Henderson
2001-01-02  3:19 Richard Kenner
2001-01-02 10:55 Richard Kenner

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=20010102180150.A2460@hg.cs.mu.oz.au \
    --to=fjh@cs.mu.oz.au \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=peter@gerwinski.de \
    /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).