public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/14036] New: tree-ssa gcc ICEs on redeclaration of local externs to global declaration
@ 2004-02-05 23:25 fjahanian at apple dot com
  2004-02-06  0:03 ` [Bug c/14036] [tree-ssa] [unit-at-a-time] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: fjahanian at apple dot com @ 2004-02-05 23:25 UTC (permalink / raw)
  To: gcc-bugs

Following test case ICEs on tree-ssa gcc with -O2. A possible patch is attached. With this patch.
gap program of the SPEC benchmark compiles with -O3 and IMI (which uncovered this bug). 
I have not run any other tests at this time.

void first ( )
{
  extern char         In;
}

void second ()
{
  extern char         In;
}

char         In;

mygccf5 -O2 -c gap.c
gap.c: In function `first':
gap.c:2: internal compiler error: in expand_var, at expr.c:6240
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

And here is my proposed patch:

Index: c-decl.c
============================================================
=======
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.334.2.79
diff -c -p -r1.334.2.79 c-decl.c
*** c-decl.c    30 Jan 2004 13:13:31 -0000      1.334.2.79
--- c-decl.c    5 Feb 2004 23:23:22 -0000

*************** pushdecl (tree x)
*** 1712,1717 ****
--- 1731,1738 ----
                    break;
                  }
            }
+         else
+           old = copy_node (old);
          return old;
        }
        if (DECL_EXTERNAL (x) || scope == global_scope)

-- 
           Summary: tree-ssa gcc ICEs on redeclaration of local externs to
                    global declaration
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fjahanian at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: gcc -c -O2 gap.c
  GCC host triplet: ppc apple darwin
GCC target triplet: ppc apple darwin


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14036


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

* [Bug c/14036] [tree-ssa] [unit-at-a-time] gcc ICEs on redeclaration of local externs to global declaration
  2004-02-05 23:25 [Bug c/14036] New: tree-ssa gcc ICEs on redeclaration of local externs to global declaration fjahanian at apple dot com
@ 2004-02-06  0:03 ` pinskia at gcc dot gnu dot org
  2004-02-09 22:27 ` fjahanian at apple dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-06  0:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-06 00:03 -------
Confirmed, I almost think this was an side effect of Zack's rewrite to c-decl.c.  Also only -funit-at-a-
time is needed to get the ICE.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zack at gcc dot gnu dot org,
                   |                            |pinskia at gcc dot gnu dot
                   |                            |org, hubicka at gcc dot gnu
                   |                            |dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
  GCC build triplet|gcc -c -O2 gap.c            |
   GCC host triplet|ppc apple darwin            |
 GCC target triplet|ppc apple darwin            |
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |tree-ssa
      Known to work|                            |3.4.0 3.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-06 00:03:53
               date|                            |
            Summary|tree-ssa gcc ICEs on        |[tree-ssa] [unit-at-a-time]
                   |redeclaration of local      |gcc ICEs on redeclaration of
                   |externs to global           |local externs to global
                   |declaration                 |declaration
   Target Milestone|---                         |tree-ssa


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14036


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

* [Bug c/14036] [tree-ssa] [unit-at-a-time] gcc ICEs on redeclaration of local externs to global declaration
  2004-02-05 23:25 [Bug c/14036] New: tree-ssa gcc ICEs on redeclaration of local externs to global declaration fjahanian at apple dot com
  2004-02-06  0:03 ` [Bug c/14036] [tree-ssa] [unit-at-a-time] " pinskia at gcc dot gnu dot org
@ 2004-02-09 22:27 ` fjahanian at apple dot com
  2004-03-10 16:50 ` pinskia at gcc dot gnu dot org
  2004-03-10 16:54 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: fjahanian at apple dot com @ 2004-02-09 22:27 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |zack at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14036


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

* [Bug c/14036] [tree-ssa] [unit-at-a-time] gcc ICEs on redeclaration of local externs to global declaration
  2004-02-05 23:25 [Bug c/14036] New: tree-ssa gcc ICEs on redeclaration of local externs to global declaration fjahanian at apple dot com
  2004-02-06  0:03 ` [Bug c/14036] [tree-ssa] [unit-at-a-time] " pinskia at gcc dot gnu dot org
  2004-02-09 22:27 ` fjahanian at apple dot com
@ 2004-03-10 16:50 ` pinskia at gcc dot gnu dot org
  2004-03-10 16:54 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-10 16:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-10 16:50 -------
The problem is that when converting from generic to gimple, the variable goes from 
extern to static for some reason.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14036


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

* [Bug c/14036] [tree-ssa] [unit-at-a-time] gcc ICEs on redeclaration of local externs to global declaration
  2004-02-05 23:25 [Bug c/14036] New: tree-ssa gcc ICEs on redeclaration of local externs to global declaration fjahanian at apple dot com
                   ` (2 preceding siblings ...)
  2004-03-10 16:50 ` pinskia at gcc dot gnu dot org
@ 2004-03-10 16:54 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-10 16:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-10 16:54 -------
Since my analysis applies to why this one fails is the same as PR 14065 so closing this 
as a dup.

*** This bug has been marked as a duplicate of 14065 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14036


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

end of thread, other threads:[~2004-03-10 16:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-05 23:25 [Bug c/14036] New: tree-ssa gcc ICEs on redeclaration of local externs to global declaration fjahanian at apple dot com
2004-02-06  0:03 ` [Bug c/14036] [tree-ssa] [unit-at-a-time] " pinskia at gcc dot gnu dot org
2004-02-09 22:27 ` fjahanian at apple dot com
2004-03-10 16:50 ` pinskia at gcc dot gnu dot org
2004-03-10 16:54 ` pinskia at gcc dot gnu dot org

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