public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: jbuck@synopsys.COM
To: gcc-gnats@gcc.gnu.org
Subject: c++/4447: c++ ICE (segfault in mangle.c). Regression from 2.95.x!
Date: Tue, 02 Oct 2001 16:16:00 -0000	[thread overview]
Message-ID: <200110022312.QAA07223@atrus.synopsys.com> (raw)

>Number:         4447
>Category:       c++
>Synopsis:       c++ ICE (segfault in mangle.c). Regression from 2.95.x!
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 02 16:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Joe Buck
>Release:        3.0.2 20011002 (prerelease)
>Organization:
Synopsys
>Environment:
System: SunOS atrus 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-Enterprise
Architecture: sun4

	
host: sparc-sun-solaris2.7
build: sparc-sun-solaris2.7
target: sparc-sun-solaris2.7
configured with: ../gcc/configure --prefix=/u/jbuck/gcc-cvs
>Description:

With the attached code, gcc gets an internal compiler error.
The immediate cause is that a null pointer is passed to strlen.
The cc1plus stack trace is

#0  0xff2b6dec in strlen ()
#1  0xc6734 in write_expression (expr=0x3c2570)
    at ../../gcc/gcc/cp/mangle.c:1818
#2  0xc67b4 in write_expression (expr=0x3c259c)
    at ../../gcc/gcc/cp/mangle.c:1831
#3  0xc6ff4 in write_template_arg (node=0x3c2588)
    at ../../gcc/gcc/cp/mangle.c:1941
#4  0xc6624 in write_template_args (args=0x3c2614)
    at ../../gcc/gcc/cp/mangle.c:1740
#5  0xc4458 in write_name (decl=0x3c0af8, ignore_local_scope=0)
    at ../../gcc/gcc/cp/mangle.c:712
#6  0xc5848 in write_type (type=0x3c0a28) at ../../gcc/gcc/cp/mangle.c:1393
#7  0xc6440 in write_bare_function_type (type=0x3c0ea0, 
    include_return_type_p=1, decl=0x3c7cd8) at ../../gcc/gcc/cp/mangle.c:1632
#8  0xc4320 in write_encoding (decl=0x3c7cd8) at ../../gcc/gcc/cp/mangle.c:657
#9  0xc7688 in mangle_decl_string (decl=0x3c7cd8)
    at ../../gcc/gcc/cp/mangle.c:623
#10 0xc7940 in mangle_decl (decl=0x3c7cd8) at ../../gcc/gcc/cp/mangle.c:2200

	
>How-To-Repeat:

This simplified example is based on code for efficient fixed-point
arithmetic.  To get the crash, do

gcc -c crash.ii

where crash.ii is

-------------------------------
template<bool B,int I>
class T {
public:
    T(int);
};

template<bool B1,bool B2,int I1,int I2>
T<(B1&&B2),I1+I2-int(B1&&B2)> 
func(T<B1,I1> a, T<B2,I2> b) {
    return T<(B1&&B2),I1+I2-int(B1&&B2)> (I1+I2);
}

void foo(T<true,3> a, T<true,4>b) {
    func(a, b);
}
-------------------------------

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


             reply	other threads:[~2001-10-02 16:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-02 16:16 jbuck [this message]
2001-10-07  4:19 lerdsuwa
2001-11-09 12:56 lerdsuwa
2001-11-09 13:16 lerdsuwa

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=200110022312.QAA07223@atrus.synopsys.com \
    --to=jbuck@synopsys.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /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).