public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/26169]  New: [4.2 Regression] ICE in duplicate_ssa_name
@ 2006-02-08  4:17 pinskia at gcc dot gnu dot org
  2006-02-08  4:20 ` [Bug tree-optimization/26169] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-08  4:17 UTC (permalink / raw)
  To: gcc-bugs

Reduced Testcase:
static int unit_cache[3];
void find_unit_1 (int n, int do_create)
{
  int *p;
  int c, created = 0;
  if (p == 0)
    if (do_create)
      created = 1;
  for (c = 0; c < 2; c++)
    unit_cache[c] = unit_cache[c + 1];
  if (created)
    dec_waiting_unlocked (p);
}


-- 
           Summary: [4.2 Regression] ICE in duplicate_ssa_name
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, build
          Severity: blocker
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


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

* [Bug tree-optimization/26169] [4.2 Regression] ICE in duplicate_ssa_name
  2006-02-08  4:17 [Bug tree-optimization/26169] New: [4.2 Regression] ICE in duplicate_ssa_name pinskia at gcc dot gnu dot org
@ 2006-02-08  4:20 ` pinskia at gcc dot gnu dot org
  2006-02-08  4:22 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-08  4:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-02-08 04:20 -------
Compile that testcase with -O2 and you will recieve an ICE.
Backtrace:
#0  internal_error (gmsgid=0x9a973c "tree check: %s, have %s in %s, at %s:%d")
at /Users/pinskia/src/gcc/local/gcc/gcc/diagnostic.c:586
#1  0x002c8280 in tree_check_failed (node=0x42caf5e4, file=0x9aac6c
"/Users/pinskia/src/gcc/local/gcc/gcc/tree-ssanames.c", line=247,
function=0x9aacd8 "duplicate_ssa_name") at
/Users/pinskia/src/gcc/local/gcc/gcc/tree.c:6034
#2  0x002f77d0 in duplicate_ssa_name (name=0x42caf5e4, stmt=0x42cb418c) at
/Users/pinskia/src/gcc/local/gcc/gcc/tree-ssanames.c:247
#3  0x006650b8 in create_new_def_for (old_name=0x42caf5e4, stmt=0x42cb418c,
def=0x42cb0534) at /Users/pinskia/src/gcc/local/gcc/gcc/tree-into-ssa.c:2241
#4  0x0047d2dc in tree_duplicate_bb (bb=0x42c15528) at
/Users/pinskia/src/gcc/local/gcc/gcc/tree-cfg.c:4341
#5  0x004870b4 in duplicate_block (bb=0x42c15528, e=0x0, after=0x0) at
/Users/pinskia/src/gcc/local/gcc/gcc/cfghooks.c:716
#6  0x008f0adc in create_block_for_threading (bb=0x42c15528, rd=0x41e011c0) at
/Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-threadupdate.c:210
#7  0x008f0ec8 in create_duplicates (slot=0x41e05eb8, data=0xbffff640) at
/Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-threadupdate.c:350
#8  0x009744d4 in htab_traverse_noresize (htab=0x9a973c, callback=0x8f0e58
<create_duplicates>, info=0xbffff640) at
/Users/pinskia/src/gcc/local/gcc/libiberty/hashtab.c:729
#9  0x008f1910 in thread_block (bb=0x42c15528) at
/Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-threadupdate.c:790
#10 0x008f1ba0 in thread_through_all_blocks () at
/Users/pinskia/src/gcc/local/gcc/gcc/tree-ssa-threadupdate.c:872
#11 0x0072e418 in finalize_jump_threads () at
/Users/pinskia/src/gcc/local/gcc/gcc/tree-vrp.c:4361
#12 0x0072e814 in execute_vrp () at
/Users/pinskia/src/gcc/local/gcc/gcc/tree-vrp.c:4502


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu dot org
 GCC target triplet|                            |powerpc-darwin7.9.0
   Target Milestone|---                         |4.2.0


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


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

* [Bug tree-optimization/26169] [4.2 Regression] ICE in duplicate_ssa_name
  2006-02-08  4:17 [Bug tree-optimization/26169] New: [4.2 Regression] ICE in duplicate_ssa_name pinskia at gcc dot gnu dot org
  2006-02-08  4:20 ` [Bug tree-optimization/26169] " pinskia at gcc dot gnu dot org
@ 2006-02-08  4:22 ` pinskia at gcc dot gnu dot org
  2006-02-08  7:55 ` law at redhat dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-08  4:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-02-08 04:22 -------
I should say this was while building libgfortran/io/unit.c which makes this a
blocker.


-- 


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


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

* [Bug tree-optimization/26169] [4.2 Regression] ICE in duplicate_ssa_name
  2006-02-08  4:17 [Bug tree-optimization/26169] New: [4.2 Regression] ICE in duplicate_ssa_name pinskia at gcc dot gnu dot org
  2006-02-08  4:20 ` [Bug tree-optimization/26169] " pinskia at gcc dot gnu dot org
  2006-02-08  4:22 ` pinskia at gcc dot gnu dot org
@ 2006-02-08  7:55 ` law at redhat dot com
  2006-02-08 12:43 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: law at redhat dot com @ 2006-02-08  7:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from law at redhat dot com  2006-02-08 07:55 -------
Subject: Re:  [4.2 Regression] ICE in
        duplicate_ssa_name

On Wed, 2006-02-08 at 04:22 +0000, pinskia at gcc dot gnu dot org wrote:
> 
> ------- Comment #2 from pinskia at gcc dot gnu dot org  2006-02-08 04:22 -------
> I should say this was while building libgfortran/io/unit.c which makes this a
> blocker.
I didn't trip over anything like this on my x86 testing, but I have
been able to reproduce it with a cross compiler.  The fix is
pretty trivial, but it'll take until sometime tomorrow before the
regression testing and such is complete.

jeff


-- 


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


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

* [Bug tree-optimization/26169] [4.2 Regression] ICE in duplicate_ssa_name
  2006-02-08  4:17 [Bug tree-optimization/26169] New: [4.2 Regression] ICE in duplicate_ssa_name pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-02-08  7:55 ` law at redhat dot com
@ 2006-02-08 12:43 ` pinskia at gcc dot gnu dot org
  2006-02-08 16:10 ` uweigand at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-08 12:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-02-08 12:43 -------
(In reply to comment #3)
> I didn't trip over anything like this on my x86 testing, but I have
> been able to reproduce it with a cross compiler.  The fix is
> pretty trivial, but it'll take until sometime tomorrow before the
> regression testing and such is complete.

I should mention why you did not trip over it on the x86 testing orginally.
This:
  if (p == 0)
    if (do_create)
Was orginally:
  if (p == 0 && do_create)
Which causes a slightly different IR.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-02-08 12:43:51
               date|                            |


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


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

* [Bug tree-optimization/26169] [4.2 Regression] ICE in duplicate_ssa_name
  2006-02-08  4:17 [Bug tree-optimization/26169] New: [4.2 Regression] ICE in duplicate_ssa_name pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-02-08 12:43 ` pinskia at gcc dot gnu dot org
@ 2006-02-08 16:10 ` uweigand at gcc dot gnu dot org
  2006-02-08 16:55 ` law at redhat dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: uweigand at gcc dot gnu dot org @ 2006-02-08 16:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from uweigand at gcc dot gnu dot org  2006-02-08 16:10 -------
FYI -- this also breaks bootstrap on s390-ibm-linux and s390x-ibm-linux:

../../../gcc-head/libgfortran/io/unit.c: In function 'find_unit_1':
../../../gcc-head/libgfortran/io/unit.c:269: internal compiler error: tree
check: expected ssa_name, have struct_field_tag in duplicate_ssa_name, at
tree-ssanames.c:247
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


-- 

uweigand at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uweigand at gcc dot gnu dot
                   |                            |org


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


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

* [Bug tree-optimization/26169] [4.2 Regression] ICE in duplicate_ssa_name
  2006-02-08  4:17 [Bug tree-optimization/26169] New: [4.2 Regression] ICE in duplicate_ssa_name pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-02-08 16:10 ` uweigand at gcc dot gnu dot org
@ 2006-02-08 16:55 ` law at redhat dot com
  2006-02-08 17:46 ` law at redhat dot com
  2006-02-08 17:47 ` law at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: law at redhat dot com @ 2006-02-08 16:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from law at redhat dot com  2006-02-08 16:55 -------
Subject: Re:  [4.2 Regression] ICE in
        duplicate_ssa_name

On Wed, 2006-02-08 at 16:10 +0000, uweigand at gcc dot gnu dot org
wrote:
> 
> ------- Comment #5 from uweigand at gcc dot gnu dot org  2006-02-08 16:10 -------
> FYI -- this also breaks bootstrap on s390-ibm-linux and s390x-ibm-linux:
> 
> ../../../gcc-head/libgfortran/io/unit.c: In function 'find_unit_1':
> ../../../gcc-head/libgfortran/io/unit.c:269: internal compiler error: tree
> check: expected ssa_name, have struct_field_tag in duplicate_ssa_name, at
> tree-ssanames.c:247
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Should be fixed within the next couple hours - just waiting on
regression testing to finish...
jeff


-- 


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


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

* [Bug tree-optimization/26169] [4.2 Regression] ICE in duplicate_ssa_name
  2006-02-08  4:17 [Bug tree-optimization/26169] New: [4.2 Regression] ICE in duplicate_ssa_name pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-02-08 16:55 ` law at redhat dot com
@ 2006-02-08 17:46 ` law at redhat dot com
  2006-02-08 17:47 ` law at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: law at redhat dot com @ 2006-02-08 17:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from law at redhat dot com  2006-02-08 17:46 -------
Subject: Re:  [4.2 Regression] ICE in
        duplicate_ssa_name

On Wed, 2006-02-08 at 12:43 +0000, pinskia at gcc dot gnu dot org wrote:
> 
> ------- Comment #4 from pinskia at gcc dot gnu dot org  2006-02-08 12:43 -------
> (In reply to comment #3)
> > I didn't trip over anything like this on my x86 testing, but I have
> > been able to reproduce it with a cross compiler.  The fix is
> > pretty trivial, but it'll take until sometime tomorrow before the
> > regression testing and such is complete.
> 
> I should mention why you did not trip over it on the x86 testing orginally.
> This:
>   if (p == 0)
>     if (do_create)
> Was orginally:
>   if (p == 0 && do_create)
> Which causes a slightly different IR.
This patch should fix the various instances of the ICE in
duplicate_ssa_name.

Basically VRP performed a constant propagation, changing  the
index in an array reference from a variable to a constant.  When
this occurs we queue SSA graph updates for the virtual operands
of the statement.  As a side effect, the virtual operands are
no longer SSA_NAMEs, but instead _DECL nodes.

We then find that we're able to thread through the block containing
the updated array reference.  The block duplication code doesn't
know how to handle this case and dies.

This patch simply handles any queued SSA updates before dealing
with jump threads.  DOM does the exact same thing.

However, my gut tells me that this "solution" is mostly an artifact
of how the old old old SSA graph updating code in DOM worked.  I
suspect that it wouldn't be terribly difficult to do all the
SSA graph updates at the same time.  Doing so would probably be a
compile-time win as well.

Regardless, this patch should bring various failing targets back
into bootstrap land.

Bootstrapped and regression tested on i686-pc-linux-gnu; I've
also verified the ICE is fixed using cross compilers.










------- Comment #8 from law at redhat dot com  2006-02-08 17:46 -------
Created an attachment (id=10803)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10803&action=view)


-- 


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


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

* [Bug tree-optimization/26169] [4.2 Regression] ICE in duplicate_ssa_name
  2006-02-08  4:17 [Bug tree-optimization/26169] New: [4.2 Regression] ICE in duplicate_ssa_name pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-02-08 17:46 ` law at redhat dot com
@ 2006-02-08 17:47 ` law at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: law at redhat dot com @ 2006-02-08 17:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from law at redhat dot com  2006-02-08 17:46 -------
Fixed with attached patch.


-- 

law at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2006-02-08 17:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-08  4:17 [Bug tree-optimization/26169] New: [4.2 Regression] ICE in duplicate_ssa_name pinskia at gcc dot gnu dot org
2006-02-08  4:20 ` [Bug tree-optimization/26169] " pinskia at gcc dot gnu dot org
2006-02-08  4:22 ` pinskia at gcc dot gnu dot org
2006-02-08  7:55 ` law at redhat dot com
2006-02-08 12:43 ` pinskia at gcc dot gnu dot org
2006-02-08 16:10 ` uweigand at gcc dot gnu dot org
2006-02-08 16:55 ` law at redhat dot com
2006-02-08 17:46 ` law at redhat dot com
2006-02-08 17:47 ` law at redhat dot com

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