Bug 17827 - [3.4 Regression] ICE: in make_decl_rtl, at varasm.c:752
Summary: [3.4 Regression] ICE: in make_decl_rtl, at varasm.c:752
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 3.4.2
: P2 critical
Target Milestone: 3.4.4
Assignee: Eric Botcazou
URL:
Keywords: ice-on-valid-code, monitored
: 20485 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-04 08:48 UTC by André Wöbbeking
Modified: 2005-03-16 01:08 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.3.5 4.0.0
Known to fail: 3.4.3
Last reconfirmed: 2004-10-04 11:47:49


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description André Wöbbeking 2004-10-04 08:48:30 UTC
Hi, 
 
the following code doesn't compile. It's related to my PR 14203 (or from Debian 
BR #233548). GCC 3.4.1 works fine. 
 
 
André 
 
 
struct Dummy 
{ 
    void foo(); 
}; 
 
const bool g_bAlways = false; 
 
int main() 
{ 
    bool test; 
    if (g_bAlways) 
    { 
        if (Dummy* dummy = 0) 
        { 
            if (!test) 
            { 
                int d; 
                d = 1; 
            } 
            dummy->foo(); 
         } 
     } 
 
     return 0; 
}
Comment 1 Andrew Pinski 2004-10-04 11:47:49 UTC
: Search converges between 2004-08-23-3.4 (#55) and 2004-08-24-3.4 (#56).
Confirmed.
Comment 2 Volker Reichelt 2004-10-07 01:41:48 UTC
Here's something shorter. It also crashes gcc 3.4.0 and 3.4.1.

=================================
void foo()
{
    if (0)
        if (int* p = 0)
            int i=*p;
}
=================================

: Search converges between 2003-04-16-trunk (#231) and 2003-04-17-trunk (#232).
Comment 3 Volker Reichelt 2004-10-07 02:04:02 UTC
Roger, ii looks like your patch
http://gcc.gnu.org/ml/gcc-cvs/2003-04/msg00812.html
is responsible for the regression. Could you please have a look?
Comment 4 André Wöbbeking 2004-10-07 09:49:31 UTC
(In reply to comment #2) 
> Here's something shorter. It also crashes gcc 3.4.0 and 3.4.1. 
>  
> ================================= 
> void foo() 
> { 
>     if (0) 
>         if (int* p = 0) 
>             int i=*p; 
> } 
 
Indeed, this looks very similar to your shorter version in PR 14203. 
Comment 5 Volker Reichelt 2004-10-07 10:54:02 UTC
Here's a testcase that looks even more like PR 14203
(and there's no dereferencing of the null pointer - even
if that was unreachable)

===============================
void foo()
{
  if (false)
    if (int i=0)
      int j=i;
}
===============================
Comment 6 Mark Mitchell 2004-11-01 00:46:26 UTC
Postponed until GCC 3.4.4.
Comment 7 Eric Botcazou 2004-12-05 10:17:52 UTC
Testing a fix.
Comment 8 Eric Botcazou 2004-12-05 10:19:14 UTC
Recategorizing.
Comment 10 Eric Botcazou 2004-12-07 07:55:52 UTC
See http://gcc.gnu.org/ml/gcc-patches/2004-12/msg00407.html
Comment 11 Volker Reichelt 2005-03-16 01:08:07 UTC
*** Bug 20485 has been marked as a duplicate of this bug. ***