public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed.
@ 2004-06-27  6:53 debian-gcc at lists dot debian dot org
  2004-06-27  8:11 ` [Bug tree-optimization/16225] " debian-gcc at lists dot debian dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2004-06-27  6:53 UTC (permalink / raw)
  To: gcc-bugs

[forwarded from http://bugs.debian.org/256452]

HEAD 20040626, ok with 3.3.4 and 3.4.1.

gcc -O bitcnt_4.i
bitcnt_4.c: In function `btbl_bitcnt':
bitcnt_4.c:54: error: PHI argument duplicated for edge 1->0

PHI argument
x<D2622>_20

for PHI node
x<D2622>_9 = PHI <x<D2622>_22(-1), x.146<D2631>_16(1), x<D2622>_20(1)>;

bitcnt_4.c:54: internal compiler error: verify_ssa failed.
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

-- 
           Summary: [3.5 regression] ICE: verify_ssa failed.
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
@ 2004-06-27  8:11 ` debian-gcc at lists dot debian dot org
  2004-06-27  8:25 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2004-06-27  8:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From debian-gcc at lists dot debian dot org  2004-06-27 06:53 -------
Created an attachment (id=6636)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6636&action=view)
testcase


-- 


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
  2004-06-27  8:11 ` [Bug tree-optimization/16225] " debian-gcc at lists dot debian dot org
@ 2004-06-27  8:25 ` pinskia at gcc dot gnu dot org
  2004-06-27  9:37 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-27  8:25 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |3.5.0


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
  2004-06-27  8:11 ` [Bug tree-optimization/16225] " debian-gcc at lists dot debian dot org
  2004-06-27  8:25 ` pinskia at gcc dot gnu dot org
@ 2004-06-27  9:37 ` pinskia at gcc dot gnu dot org
  2004-07-20  8:52 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-27  9:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-27 08:54 -------
Confirmed, here is the reduced testcase:
typedef unsigned long uint32;
int ntbl_bitcnt(uint32 x);
int btbl_bitcnt(uint32 x);
char bits[256];
int btbl_bitcnt(uint32 x)
{
      int cnt = bits[ ((char *)&x)[0] & 0xFF ];
      if (0L != (x >>= 8))
            cnt += btbl_bitcnt(x);
      return cnt;
}

I think this is caused by tail recursion.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-27 08:54:15
               date|                            |


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
                   ` (2 preceding siblings ...)
  2004-06-27  9:37 ` pinskia at gcc dot gnu dot org
@ 2004-07-20  8:52 ` pinskia at gcc dot gnu dot org
  2004-07-20 16:17 ` rakdver at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-20  8:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-20 08:52 -------
I get a slightly different ICE now:
pr16225.c: In function `btbl_bitcnt':
pr16225.c:9: internal compiler error: in may_propagate_copy, at tree-ssa-copy.c:130
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Here is a little simpler code:
typedef unsigned long uint32;

int ntbl_bitcnt(uint32 x);
int btbl_bitcnt(uint32 x);

char bits[256];

int btbl_bitcnt(uint32 x)
{
      int cnt = *(char *)&x;

      if (0L != (x >>= 8))
            return btbl_bitcnt(x);
      return cnt;
}

oh it looks like tree-loop-ch which causing this.

Maybe this is the going in and out of ssa which is causing this problem and causing to loose aliasing 
info.

-- 


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
                   ` (3 preceding siblings ...)
  2004-07-20  8:52 ` pinskia at gcc dot gnu dot org
@ 2004-07-20 16:17 ` rakdver at gcc dot gnu dot org
  2004-07-30  6:50 ` zhangjie at magima dot com dot cn
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-07-20 16:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rakdver at gcc dot gnu dot org  2004-07-20 16:17 -------
Indeed there is a problem in tailr that is confused by function argument that
is also used as a name tag.

Since tree-loop-ch does not go into and out of ssa and does not
lose aliasing info, I don't understand the remark at the second bug
(that maybe should get a separate PR?)

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rakdver at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
                   ` (4 preceding siblings ...)
  2004-07-20 16:17 ` rakdver at gcc dot gnu dot org
@ 2004-07-30  6:50 ` zhangjie at magima dot com dot cn
  2004-07-30 17:28 ` giovannibajo at libero dot it
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: zhangjie at magima dot com dot cn @ 2004-07-30  6:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zhangjie at magima dot com dot cn  2004-07-30 06:50 -------
I believe the bug is caused by a problem in alias analysis. At the end of
alias1, TMT.9 might alias x and bits:

    Variable: TMT.9, UID 13, is global, call clobbered, may aliases: { x bits }

and was call-clobbered. However, add_may_alias () failed to set x call-clobbered:

    Variable: x, UID 1, is an alias tag, default def: x_9

This inconsistency resulted in the bug. At the one hand, add_stmt_operand ()
added x as a V_MAY_DEF when renaming variables at the end of alias1 because x
wass an alias of TMT.9 and TMT.9 was call-clobbered. At the other hand, tailr1
pass failed to recognize that x was an alias of a call-clobbered variable. It
was executed.

This patch will make the call-clobbered information consistent and fix this bug.


2004-07-30  Jie Zhang  <zhangjie@magima.com.cn>

	PR tree-optimization/16225
	* tree-ssa-alias.c (add_may_alias): If 'alias' is call-clobbered, so
	are 'var' and its aliases.

*** tree-ssa-alias.c.old	2004-07-24 09:05:44.000000000 +0800
--- tree-ssa-alias.c	2004-07-30 13:13:06.000000000 +0800
*************** add_may_alias (tree var, tree alias)
*** 1678,1686 ****
    if (is_call_clobbered (var))
      mark_call_clobbered (alias);
  
!   /* Likewise.  If ALIAS is call-clobbered, so is VAR.  */
    else if (is_call_clobbered (alias))
!     mark_call_clobbered (var);
  
    VARRAY_PUSH_TREE (v_ann->may_aliases, alias);
    a_ann->is_alias_tag = 1;
--- 1678,1690 ----
    if (is_call_clobbered (var))
      mark_call_clobbered (alias);
  
!   /* Likewise.  If ALIAS is call-clobbered, so are VAR and its aliases.  */
    else if (is_call_clobbered (alias))
!     {
!       mark_call_clobbered (var);
!       for (i = 0; i < VARRAY_ACTIVE_SIZE (v_ann->may_aliases); i++)
!         mark_call_clobbered (VARRAY_TREE (v_ann->may_aliases, i));
!     }
  
    VARRAY_PUSH_TREE (v_ann->may_aliases, alias);
    a_ann->is_alias_tag = 1;


-- 


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
                   ` (5 preceding siblings ...)
  2004-07-30  6:50 ` zhangjie at magima dot com dot cn
@ 2004-07-30 17:28 ` giovannibajo at libero dot it
  2004-08-01 16:09 ` zhangjie at magima dot com dot cn
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-07-30 17:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-07-30 17:28 -------
If the patch is right, it could contain also an update to verify_alias to make 
it catch such situations earlier, in the future.

-- 


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
                   ` (6 preceding siblings ...)
  2004-07-30 17:28 ` giovannibajo at libero dot it
@ 2004-08-01 16:09 ` zhangjie at magima dot com dot cn
  2004-08-01 21:33 ` giovannibajo at libero dot it
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: zhangjie at magima dot com dot cn @ 2004-08-01 16:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zhangjie at magima dot com dot cn  2004-08-01 16:09 -------
I add the following check in verify_flow_insensitive_alias_info (). It shows
that there are some other mark_call_clobbered () call sites, which will fail the
check. I'm going to look them closer.

Index: tree-ssa.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/tree-ssa.c,v
retrieving revision 2.26
diff -C3 -p -r2.26 tree-ssa.c
*** tree-ssa.c	29 Jul 2004 20:16:26 -0000	2.26
--- tree-ssa.c	1 Aug 2004 14:38:57 -0000
*************** verify_flow_insensitive_alias_info (void
*** 368,373 ****
--- 368,386 ----
  	      debug_variable (alias);
  	      goto err;
  	    }
+ 
+ 	  if (is_call_clobbered (var) && !is_call_clobbered (alias))
+ 	    {
+ 	      error ("Variable is call-clobbered, but its alias is not.");
+ 	      debug_variable (alias);
+ 	      goto err;
+ 	    }
+ 	  else if (!is_call_clobbered (var) && is_call_clobbered (alias))
+ 	    {
+ 	      error ("Variable is not call-clobbered, but its alias is.");
+ 	      debug_variable (alias);
+ 	      goto err;
+ 	    }
  	}
      }
  

-- 


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
                   ` (7 preceding siblings ...)
  2004-08-01 16:09 ` zhangjie at magima dot com dot cn
@ 2004-08-01 21:33 ` giovannibajo at libero dot it
  2004-08-11 15:59 ` dnovillo at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-08-01 21:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-08-01 21:33 -------
Diego, can you have a quick look at these patches? At least, if you can comment 
on the patch to verify_flow_insensitive_alias_info, Jie would know whether it 
should work on making it bootstrap fixing the problems it exposes.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovannibajo at libero dot
                   |                            |it, dnovillo at gcc dot gnu
                   |                            |dot org


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
                   ` (8 preceding siblings ...)
  2004-08-01 21:33 ` giovannibajo at libero dot it
@ 2004-08-11 15:59 ` dnovillo at gcc dot gnu dot org
  2004-08-11 16:01 ` dnovillo at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-08-11 15:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dnovillo at gcc dot gnu dot org  2004-08-11 15:59 -------
Jie's patch in comment #4 looks OK.  I am working on something related that may
remove this quirk altogether.  We don't deal with call-clobberedness in any
reasonable way right now.

Giovanni's proposal is good, but I'm almost positive that it will trigger ICEs
in the verifier.

Zdenek, if you don't mind, I will assign this PR to myself.  It's not a problem
in your code.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|dnovillo at gcc dot gnu dot |
                   |org                         |
         AssignedTo|rakdver at gcc dot gnu dot  |dnovillo at gcc dot gnu dot
                   |org                         |org


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
                   ` (9 preceding siblings ...)
  2004-08-11 15:59 ` dnovillo at gcc dot gnu dot org
@ 2004-08-11 16:01 ` dnovillo at gcc dot gnu dot org
  2004-08-12 17:34 ` dnovillo at gcc dot gnu dot org
  2004-08-12 18:35 ` dnovillo at redhat dot com
  12 siblings, 0 replies; 14+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-08-11 16:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dnovillo at gcc dot gnu dot org  2004-08-11 16:01 -------
(In reply to comment #5)

> 2004-07-30  Jie Zhang  <zhangjie@magima.com.cn>
> 
> 	PR tree-optimization/16225
> 	* tree-ssa-alias.c (add_may_alias): If 'alias' is call-clobbered, so
> 	are 'var' and its aliases.
> 
This is OK, provided it passes bootstrap and testing.


Diego.

-- 


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
                   ` (10 preceding siblings ...)
  2004-08-11 16:01 ` dnovillo at gcc dot gnu dot org
@ 2004-08-12 17:34 ` dnovillo at gcc dot gnu dot org
  2004-08-12 18:35 ` dnovillo at redhat dot com
  12 siblings, 0 replies; 14+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-08-12 17:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dnovillo at gcc dot gnu dot org  2004-08-12 17:34 -------
(In reply to comment #10)
> (In reply to comment #5)
> 
> > 2004-07-30  Jie Zhang  <zhangjie@magima.com.cn>
> > 
> > 	PR tree-optimization/16225
> > 	* tree-ssa-alias.c (add_may_alias): If 'alias' is call-clobbered, so
> > 	are 'var' and its aliases.
> > 
> This is OK, provided it passes bootstrap and testing.
> 
Never mind.  The bug is not reproducible anymore.


Diego.

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


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


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

* [Bug tree-optimization/16225] [3.5 regression] ICE: verify_ssa failed.
  2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
                   ` (11 preceding siblings ...)
  2004-08-12 17:34 ` dnovillo at gcc dot gnu dot org
@ 2004-08-12 18:35 ` dnovillo at redhat dot com
  12 siblings, 0 replies; 14+ messages in thread
From: dnovillo at redhat dot com @ 2004-08-12 18:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dnovillo at redhat dot com  2004-08-12 18:35 -------
Subject: Re:  [3.5 regression] ICE: verify_ssa
	failed.

On Sun, 2004-08-01 at 17:33, giovannibajo at libero dot it wrote:
> ------- Additional Comments From giovannibajo at libero dot it  2004-08-01 21:33 -------
> Diego, can you have a quick look at these patches? At least, if you can comment 
> on the patch to verify_flow_insensitive_alias_info, Jie would know whether it 
> should work on making it bootstrap fixing the problems it exposes.
>
Well, call-clobberedness and aliasing are not necessarily related.

foo (int i)
{
   int *p, a, b;

   if (i > 10)
     p = &b;
   bar (&a);
   return *p;
}

Suppose that for some reason we couldn't use points-to information and
end up with alias(*p) = { a, b }.  You don't really want the call to
'bar()' to clobber 'b', so marking 'b' call-clobbered is too
pessimistic.

I'm testing a patch to only mark call-clobbered variables whose address
escape.  add_may_alias should not be setting call-clobbered bits.


Diego.



-- 


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


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

end of thread, other threads:[~2004-08-12 18:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-27  6:53 [Bug tree-optimization/16225] New: [3.5 regression] ICE: verify_ssa failed debian-gcc at lists dot debian dot org
2004-06-27  8:11 ` [Bug tree-optimization/16225] " debian-gcc at lists dot debian dot org
2004-06-27  8:25 ` pinskia at gcc dot gnu dot org
2004-06-27  9:37 ` pinskia at gcc dot gnu dot org
2004-07-20  8:52 ` pinskia at gcc dot gnu dot org
2004-07-20 16:17 ` rakdver at gcc dot gnu dot org
2004-07-30  6:50 ` zhangjie at magima dot com dot cn
2004-07-30 17:28 ` giovannibajo at libero dot it
2004-08-01 16:09 ` zhangjie at magima dot com dot cn
2004-08-01 21:33 ` giovannibajo at libero dot it
2004-08-11 15:59 ` dnovillo at gcc dot gnu dot org
2004-08-11 16:01 ` dnovillo at gcc dot gnu dot org
2004-08-12 17:34 ` dnovillo at gcc dot gnu dot org
2004-08-12 18:35 ` dnovillo 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).