public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/7754: ICE SIGSEGV on union with template parameter
@ 2002-10-03 22:25 mmitchel
  0 siblings, 0 replies; 5+ messages in thread
From: mmitchel @ 2002-10-03 22:25 UTC (permalink / raw)
  To: dv, gcc-bugs, gcc-prs, mmitchel

Synopsis: ICE SIGSEGV on union with template parameter

State-Changed-From-To: analyzed->closed
State-Changed-By: mmitchel
State-Changed-When: Thu Oct  3 22:25:08 2002
State-Changed-Why:
    Fixed in G++ 3.2.1.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7754


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/7754: ICE SIGSEGV on union with template parameter
@ 2002-10-03  0:05 mmitchel
  0 siblings, 0 replies; 5+ messages in thread
From: mmitchel @ 2002-10-03  0:05 UTC (permalink / raw)
  To: dv, gcc-bugs, gcc-prs, mmitchel, nobody

Synopsis: ICE SIGSEGV on union with template parameter

Responsible-Changed-From-To: unassigned->mmitchel
Responsible-Changed-By: mmitchel
Responsible-Changed-When: Thu Oct  3 00:05:02 2002
Responsible-Changed-Why:
    Working on a fix.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7754


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/7754: ICE SIGSEGV on union with template parameter
@ 2002-09-29  1:36 Pop Sébastian
  0 siblings, 0 replies; 5+ messages in thread
From: Pop Sébastian @ 2002-09-29  1:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/7754; it has been noted by GNATS.

From: =?iso-8859-1?Q?Pop_S=E9bastian?= <pop@gauvain.u-strasbg.fr>
To: nathan@gcc.gnu.org, dv@vollmann.ch, gcc-bugs@gcc.gnu.org,
	gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc: aoliva@redhat.com
Subject: Re: c++/7754: ICE SIGSEGV on union with template parameter
Date: Sun, 29 Sep 2002 10:29:05 +0200

 On Fri, Sep 13, 2002 at 09:04:23PM -0000, nathan@gcc.gnu.org wrote:
 > Synopsis: ICE SIGSEGV on union with template parameter
 > 
 > State-Changed-From-To: open->analyzed
 > State-Changed-By: nathan
 > State-Changed-When: Fri Sep 13 14:04:22 2002
 > State-Changed-Why:
 >     confirmed as a regression
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7754
 
 SIGSEGV happens in tree.c:
 
 /* Nonzero if integer constants T1 and T2 represent values that satisfy <.
    The precise way of comparison depends on their data type.  */
 
 int
 tree_int_cst_lt (t1, t2)
      tree t1, t2;
 {
   if (t1 == t2)
     return 0;
 
 =>if (TREE_UNSIGNED (TREE_TYPE (t1)) != TREE_UNSIGNED (TREE_TYPE (t2)))
     {
       int t1_sgn = tree_int_cst_sgn (t1);
       int t2_sgn = tree_int_cst_sgn (t2);
 
       if (t1_sgn < t2_sgn)
         return 1;
       else if (t1_sgn > t2_sgn)
         return 0;
       /* Otherwise, both are non-negative, so we compare them as
          unsigned just in case one of them would overflow a signed
          type.  */
     }
   else if (! TREE_UNSIGNED (TREE_TYPE (t1)))
     return INT_CST_LT (t1, t2);
 
   return INT_CST_LT_UNSIGNED (t1, t2);
 }
 
 
 At this point t2 is equal to 0, and that crashes the compiler.
 
 The following patch introduced this code without checking of non-NULL for t2:
 
 2002-04-26  Alexandre Oliva  <aoliva@redhat.com>
 http://gcc.gnu.org/ml/gcc-patches/2002-04/msg01549.html
 
 
 Alexandre, could you review this patch and the associated bug-report please?
 
 Thanks, 
 Sebastian


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/7754: ICE SIGSEGV on union with template parameter
@ 2002-09-13 14:04 nathan
  0 siblings, 0 replies; 5+ messages in thread
From: nathan @ 2002-09-13 14:04 UTC (permalink / raw)
  To: dv, gcc-bugs, gcc-prs, nobody

Synopsis: ICE SIGSEGV on union with template parameter

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Fri Sep 13 14:04:22 2002
State-Changed-Why:
    confirmed as a regression

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7754


^ permalink raw reply	[flat|nested] 5+ messages in thread

* c++/7754: ICE SIGSEGV on union with template parameter
@ 2002-08-28 18:36 Detlef Vollmann
  0 siblings, 0 replies; 5+ messages in thread
From: Detlef Vollmann @ 2002-08-28 18:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7754
>Category:       c++
>Synopsis:       ICE SIGSEGV on union with template parameter
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 28 18:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Detlef Vollmann
>Release:        3.3 20020828 (experimental)
>Organization:
vollmann engineering gmbh
>Environment:
System: Linux octo 2.4.18-xfs-1.1 #1 Mon Jul 1 05:12:32 MEST 2002 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /dwarf/pdsrc/gcc/cvs/gcc/configure --program-suffix=-test --prefix=/usr/local/gcc-test --enable-shared --enable-threads=posix --enable-version-specific-runtime-libs --enable-languages=c,c++
>Description:
	Segmentation fault wrapped as ICE for a union with a member
	whose type is a template parameter of surrounding function.
>How-To-Repeat:
	gcc -c bug.cpp
>Fix:
	

bug.cpp:
template <typename T> void f(T const &t)
{
    union { char c; T t_; }; // compile time check for T==POD
}
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-10-04  5:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-03 22:25 c++/7754: ICE SIGSEGV on union with template parameter mmitchel
  -- strict thread matches above, loose matches on Subject: below --
2002-10-03  0:05 mmitchel
2002-09-29  1:36 Pop Sébastian
2002-09-13 14:04 nathan
2002-08-28 18:36 Detlef Vollmann

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).