c/2765: File-scope division by zero causes segfault

neil@gcc.gnu.org neil@gcc.gnu.org
Mon May 7 11:06:00 GMT 2001


>Number:         2765
>Category:       c
>Synopsis:       File-scope division by zero causes segfault
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 07 11:06:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     neil@gcc.gnu.org
>Release:        GCC 3.0 (20010506)
>Organization:
>Environment:

>Description:
Compile the following line:-

int i = 8/0;

I've marked this high since it's a regression from 2.95.2.
I believe it's a C front end bug, although the segfault
is caused in gen_emit_rtl, which dereferences a null
pointer (cfunc).  We should probably not have proceeded
that far, though I don't know the right place.

Possibly
	pedwarn ("initializer element is not computable at load time");
in digest_init should also have
        inside_init = error_mark_node;
but this is probably covering up the real problem.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list