This is the mail archive of the
mailing list for the GCC project.
Re: c++/7754: ICE SIGSEGV on union with template parameter
- From: Pop Sébastian <pop at gauvain dot u-strasbg dot fr>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 29 Sep 2002 08:36:01 -0000
- Subject: Re: c++/7754: ICE SIGSEGV on union with template parameter
- Reply-to: Pop Sébastian <pop at gauvain dot u-strasbg dot fr>
The following reply was made to PR c++/7754; it has been noted by GNATS.
From: =?iso-8859-1?Q?Pop_S=E9bastian?= <email@example.com>
To: firstname.lastname@example.org, email@example.com, firstname.lastname@example.org,
email@example.com, firstname.lastname@example.org, email@example.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, firstname.lastname@example.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
> confirmed as a regression
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. */
tree_int_cst_lt (t1, t2)
tree t1, t2;
if (t1 == t2)
=>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)
else if (t1_sgn > t2_sgn)
/* Otherwise, both are non-negative, so we compare them as
unsigned just in case one of them would overflow a signed
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 <email@example.com>
Alexandre, could you review this patch and the associated bug-report please?