public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/27793] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
@ 2006-05-29 10:47 ` rguenth at gcc dot gnu dot org
  2006-05-29 10:48 ` rguenth at gcc dot gnu dot org
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-29 10:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2006-05-29 10:47 -------
Created an attachment (id=11529)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11529&action=view)
testcase


-- 


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


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

* [Bug middle-end/27793]  New: num_ssa_names inconsistent or immediate use iterator wrong
@ 2006-05-29 10:47 rguenth at gcc dot gnu dot org
  2006-05-29 10:47 ` [Bug middle-end/27793] " rguenth at gcc dot gnu dot org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-29 10:47 UTC (permalink / raw)
  To: gcc-bugs

The testcase I'll attach momentarily segfaults/ICEs at random places for a
checking enabled 4.1.1 compiler.  Valgrind has more useful information as

==31272== Invalid read of size 4
==31272==    at 0x82AC3C3: verify_ssa (tree-ssa.c:746)
==31272==    by 0x8731ED8: execute_todo (passes.c:761)
...
==31272==  Address 0x456FA58 is 8 bytes after a block of size 120 alloc'd
==31272==    at 0x402064B: calloc (in
/usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==31272==    by 0x88D0817: xcalloc (xmalloc.c:162)
==31272==    by 0x82ABA7F: verify_ssa (tree-ssa.c:637)

which means we access definition_block[SSA_NAME_VERSION (op)] with
SSA_NAME_VERSION (op) >= num_ssa_names.  Attaching with gdb at this point
also shows op being corrupt (0x433230c), so it may be well the iterator
being bogus.

It's hard to reduce the testcase further as it is very sensitive to number
of ssa names and allocation profile.


-- 
           Summary: num_ssa_names inconsistent or immediate use iterator
                    wrong
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


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

* [Bug middle-end/27793] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
  2006-05-29 10:47 ` [Bug middle-end/27793] " rguenth at gcc dot gnu dot org
@ 2006-05-29 10:48 ` rguenth at gcc dot gnu dot org
  2006-05-29 12:43 ` rguenth at gcc dot gnu dot org
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-29 10:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2006-05-29 10:48 -------
./cc1plus -march=i586  -O2  -Wall -fno-strict-aliasing -quiet demux_rtp.min.ii
-fpreprocessed -frandom-seed=0


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amacleod at redhat dot com
 GCC target triplet|                            |i686-pc-linux


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


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

* [Bug middle-end/27793] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
  2006-05-29 10:47 ` [Bug middle-end/27793] " rguenth at gcc dot gnu dot org
  2006-05-29 10:48 ` rguenth at gcc dot gnu dot org
@ 2006-05-29 12:43 ` rguenth at gcc dot gnu dot org
  2006-05-29 13:17 ` rguenth at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-29 12:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2006-05-29 12:43 -------
btw., the first error is right after the first may_alias pass.  An interesting
observation is that we have VUSEs in the dump for the afterReading fn for the
global var verbose, while they only should appear after alias, not after
into-ssa:

t26.ssa:

void afterReading(ReadBufferQueue*) (bufferQueueD.1879)
{
  struct ReadBufferQueueD.1839 * const thisD.1961;
  struct ReadBufferQueueD.1839 * const thisD.1960;
  struct _IO_FILED.1736 * stderr.5D.1885;
  const charD.3 * D.1884; 
  const charD.3 * D.1883;
  intD.2 verbose.4D.1882;

  # BLOCK 0
  # PRED: ENTRY (fallthru)
  #   VUSE <verboseD.1742_15>;
  verbose.4D.1882_1 = verboseD.1742;
  if (verbose.4D.1882_1 > 0) goto <L0>; else goto <L1>;
  # SUCC: 1 (true) 2 (false)

!?

and _15 is exactly the wrong SSA name we access later.


-- 


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


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

* [Bug middle-end/27793] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-05-29 12:43 ` rguenth at gcc dot gnu dot org
@ 2006-05-29 13:17 ` rguenth at gcc dot gnu dot org
  2006-05-29 13:46 ` rguenth at gcc dot gnu dot org
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-29 13:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2006-05-29 13:17 -------
Further reduced testcase:

extern int foo (__const char * __format, ...);
extern int verbose;
void demux_open_rtp(void)
{
    int* mem = __null;
    int* rtspClient = __null;
    char* sdpDescription;
    if (sdpDescription == __null) {
        extern int verbose;
        rtspClient = new int[verbose];
    }
    int* mediaSession = new int[4];
    int* iter = mediaSession+1;
    int* subsession;
    if ((subsession = iter) != __null) {
        foo ("%s RTP subsession\n", sdpDescription);
        if (verbose > 0)
            foo ("Increased socket receive buffer");  
    }
}
static inline const char *tag(const void *) { }
void afterReading(void* bufferQueue)
{
    if (verbose > 0)
        foo ("%s stream has been synchronized using RTCP %s\n",
             tag(bufferQueue), tag(bufferQueue));
}

fails with cc1plus -O -frandom-seed=0 --param ggc-min-expand=0 --param
ggc-min-heapsize=0 if traced with valgrind, ICEs/segfaults randomly.


-- 


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


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

* [Bug middle-end/27793] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-05-29 13:17 ` rguenth at gcc dot gnu dot org
@ 2006-05-29 13:46 ` rguenth at gcc dot gnu dot org
  2006-05-29 14:05 ` rguenth at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-29 13:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2006-05-29 13:46 -------
extern int foo (__const char * __format, ...);
extern int verbose;
void demux_open_rtp(int sdpDescription)
{
    int* rtspClient = 0;
    if (sdpDescription == 0) {
        extern int verbose;
        rtspClient = new int[verbose];
    }
    int* mediaSession = rtspClient;
    if (verbose > 0)
        foo ("Increased socket receive buffer");  
}
static inline const char *tag() { }
void afterReading(void)
{
    if (verbose > 0)
        foo ("%s%s", tag(), tag());
}


-- 


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


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

* [Bug middle-end/27793] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-05-29 13:46 ` rguenth at gcc dot gnu dot org
@ 2006-05-29 14:05 ` rguenth at gcc dot gnu dot org
  2006-05-29 14:09 ` [Bug middle-end/27793] [4.1 Regression] " rguenth at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-29 14:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2006-05-29 14:04 -------
At entry of verify_ssa of afterReading() we have

(gdb) call debug_immediate_uses ()
Immediate_uses: 

verbose.3_1 : --> single use.
if (verbose.3_1 > 0) goto <L2>; else goto <L1>;

D.1752_2 : --> single use.
foo (&"%s%s"[0], D.1752_2, D.1751_3);

D.1751_3 : --> single use.
foo (&"%s%s"[0], D.1752_2, D.1751_3);

verbose_4 : --> no uses.

(gdb) print *ssa_names
$6 = {base = {num = 5, alloc = 50, vec = {0x0}}}

but walking the fn stmts we have f.i.

701           for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
(gdb) 
703               tree stmt = bsi_stmt (bsi);
(gdb) 
706               if (check_modified_stmt && stmt_modified_p (stmt))
(gdb) call debug_generic_expr (stmt)
#   VUSE <verboseD.1734_5>;
verbose.3D.1750_1 = verboseD.1734

i.e. SSA_NAME_VERSION of 5 on the VOP, which is out of range.  Indeed, in
the verification loop

          FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter,
                                    SSA_OP_ALL_USES | SSA_OP_ALL_KILLS)
            {
              op = USE_FROM_PTR (use_p);
              if (verify_use (bb, definition_block[SSA_NAME_VERSION (op)],
                              use_p, stmt, false, !is_gimple_reg (op),
                              names_defined_in_bb))
                goto err;
            }

we end up calling verify_use with

Breakpoint 7, verify_use (bb=0xb7d38e60, def_bb=0x11, use_p=0xb7db4814, 
    stmt=0xb7d37318, check_abnormal=0 '\0', is_virtual=1 '\001', 
    names_defined_in_bb=0x8a6429c)
    at /space/rguenther/src/svn/gcc-4_1-branch/gcc/tree-ssa.c:222

where def_bb is random garbage and use_p is also bogus.


-- 


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-05-29 14:05 ` rguenth at gcc dot gnu dot org
@ 2006-05-29 14:09 ` rguenth at gcc dot gnu dot org
  2006-05-29 14:15 ` rguenth at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-29 14:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from rguenth at gcc dot gnu dot org  2006-05-29 14:09 -------
4.1.0 seems to work, as well as mainline and 4.0.3.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-checking
      Known to fail|                            |4.1.1
      Known to work|                            |4.0.3 4.1.0 4.2.0
            Summary|num_ssa_names inconsistent  |[4.1 Regression]
                   |or immediate use iterator   |num_ssa_names inconsistent
                   |wrong                       |or immediate use iterator
                   |                            |wrong


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-05-29 14:09 ` [Bug middle-end/27793] [4.1 Regression] " rguenth at gcc dot gnu dot org
@ 2006-05-29 14:15 ` rguenth at gcc dot gnu dot org
  2006-05-29 14:19 ` rguenth at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-29 14:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from rguenth at gcc dot gnu dot org  2006-05-29 14:15 -------
Reverting

Author: amacleod
Date: Tue May 16 20:51:14 2006
New Revision: 113829

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113829
Log:
Remove redundant hash table lookup when finding referenced vars.

2006-05-16  Andrew MacLeod  <amacleod@redhat.com>

        PR c++/26757
        * tree-dfa.c (struct walk_state): Remove.
        (add_referenced_var): Change Parameters.
        (find_referenced_vars): Done use a walk_state.
        (find_vars_r): Unused parameter and change parms to add_referenced_var.
        (referenced_var_insert): Assert same UID has not been inserted.
        (add_referenced_var): Check if var exists via referenced_var table.
        (get_virtual_var): Call add_referenced_var with new parameter.


makes it work.


-- 


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2006-05-29 14:15 ` rguenth at gcc dot gnu dot org
@ 2006-05-29 14:19 ` rguenth at gcc dot gnu dot org
  2006-05-29 16:14 ` pinskia at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-29 14:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from rguenth at gcc dot gnu dot org  2006-05-29 14:19 -------
Mark, can we please have the C++ frontend fixed instead of having workarounds
that cause all sorts of problems?  Please?


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2006-05-29 14:19 ` rguenth at gcc dot gnu dot org
@ 2006-05-29 16:14 ` pinskia at gcc dot gnu dot org
  2006-05-30 22:05 ` amacleod at redhat dot com
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-29 16:14 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
           Severity|normal                      |blocker
   Target Milestone|---                         |4.1.2


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2006-05-29 16:14 ` pinskia at gcc dot gnu dot org
@ 2006-05-30 22:05 ` amacleod at redhat dot com
  2006-06-01 11:48 ` jakub at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: amacleod at redhat dot com @ 2006-05-30 22:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from amacleod at redhat dot com  2006-05-30 22:05 -------
Created an attachment (id=11540)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11540&action=view)
proposed patch

yeah, not terribly suprising the bug came back. The original patch I applied
fixed a long standing issue in tree-dfa which happened to be causing the
original abort in 26757. Fixing the issue re-masked the root cause of the
problem for that testcase, and added some minimal consistency.

This testcase shows the root problem indeed still exist.  You can make the
problem "dissappear" again by referencing the global version of the variable
"verbose" first, before you mention the local extern version which gets a
different address.

What happens is that the ssa mechanism for dealing with referenced vars only
expects to see a single DECL_UID per pointer.  The first one it encounters is
entered into the hash table, and used to clear out the variable annotation on
the way out of ssa.  If the GLOBAL version of the variable is encountered
first, it gets entered into the table, and the annotation cleared on the way
out of ssa. This means its ready for use in the next function.

If the local version of the variable is encountered first, the global variable
never gets it annotation cleared since the local variable is the one in the
hash table. Things then go wonky in the next function to use it.

so, how to fix this for good. If it isnt going to change in the front end, we
have to maintain a list of duplicate pointers for DECL_UIDS... it could be done
without too much hassle, but its a real hack. I've attached a patch to do just
that. Try it out. Its going through bootstrapped test cycles now.


-- 


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2006-05-30 22:05 ` amacleod at redhat dot com
@ 2006-06-01 11:48 ` jakub at gcc dot gnu dot org
  2006-06-01 14:59 ` mark at codesourcery dot com
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-06-01 11:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jakub at gcc dot gnu dot org  2006-06-01 11:48 -------
Does the C++ FE need the exact decl after gimplification?  If not, perhaps
as a workaround pushdecl_maybe_friend could together with duplicating DECL_UID
also populate a hash table and cp-gimplify.c would use that hash table to make
sure only one of the decls with the same DECL_UID ever makes it into gimple.


-- 


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2006-06-01 11:48 ` jakub at gcc dot gnu dot org
@ 2006-06-01 14:59 ` mark at codesourcery dot com
  2006-06-06 15:02 ` amacleod at redhat dot com
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: mark at codesourcery dot com @ 2006-06-01 14:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from mark at codesourcery dot com  2006-06-01 14:59 -------
Subject: Re:  [4.1 Regression] num_ssa_names inconsistent
 or immediate use iterator wrong

jakub at gcc dot gnu dot org wrote:
> ------- Comment #11 from jakub at gcc dot gnu dot org  2006-06-01 11:48 -------
> Does the C++ FE need the exact decl after gimplification?  If not, perhaps
> as a workaround pushdecl_maybe_friend could together with duplicating DECL_UID
> also populate a hash table and cp-gimplify.c would use that hash table to make
> sure only one of the decls with the same DECL_UID ever makes it into gimple.

That's a good idea!  I would still like to fix this "the right way" at
some point (because there are other problems that would solve as well),
but your idea would probably move the hack from the middle end into the
front end.

To answer your question directly, since the C++ front end is always
unit-at-a-time, it doesn't care at all what happens after
gimplification; by the time it's gimplifying, it's done all the semantic
analysis it's going to do.


-- 


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2006-06-01 14:59 ` mark at codesourcery dot com
@ 2006-06-06 15:02 ` amacleod at redhat dot com
  2006-06-06 16:57 ` mark at codesourcery dot com
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: amacleod at redhat dot com @ 2006-06-06 15:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from amacleod at redhat dot com  2006-06-06 14:43 -------
Created an attachment (id=11609)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11609&action=view)
assert to add if Jakub's idea is implemented.

So do you want to fix it Jakub's way instead of hacking up the tree optimizer?
or would you still prefer to simply apply my patch for now in 4.1 and 4.2?

If/when Jakub's suggestion is implemented, I suggest adding the following
assert so you will know you have actually fixed it.  This assert will trigger
whenever there is a duplicate DECL_UID on a  variable.  It triggers on
testcases from both this PR and 26757.


-- 


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (13 preceding siblings ...)
  2006-06-06 15:02 ` amacleod at redhat dot com
@ 2006-06-06 16:57 ` mark at codesourcery dot com
  2006-06-06 19:10 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: mark at codesourcery dot com @ 2006-06-06 16:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from mark at codesourcery dot com  2006-06-06 16:37 -------
Subject: Re:  [4.1 Regression] num_ssa_names inconsistent
 or immediate use iterator wrong

amacleod at redhat dot com wrote:
> ------- Comment #13 from amacleod at redhat dot com  2006-06-06 14:43 -------
> Created an attachment (id=11609)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11609&action=view)
>  --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11609&action=view)
> assert to add if Jakub's idea is implemented.
> 
> So do you want to fix it Jakub's way instead of hacking up the tree optimizer?
> or would you still prefer to simply apply my patch for now in 4.1 and 4.2?

Please go ahead and apply your patch.  (It's ready now, and Jakub's idea
isn't.)

> If/when Jakub's suggestion is implemented, I suggest adding the following
> assert so you will know you have actually fixed it.  This assert will trigger
> whenever there is a duplicate DECL_UID on a  variable.  It triggers on
> testcases from both this PR and 26757.

Thanks!!


-- 


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (14 preceding siblings ...)
  2006-06-06 16:57 ` mark at codesourcery dot com
@ 2006-06-06 19:10 ` pinskia at gcc dot gnu dot org
  2006-06-06 19:44 ` amacleod at redhat dot com
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-06 19:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from pinskia at gcc dot gnu dot org  2006-06-06 18:58 -------
Can someone check to see if the proposed patch also fixes PR 27894, it is the
same issue as we have:
extern CBaseEntityList *g_pEntityList;
inline IHandleEntity* CBaseHandle::Get() const
{
 extern CBaseEntityList *g_pEntityList;
....


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |27894
              nThis|                            |


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (15 preceding siblings ...)
  2006-06-06 19:10 ` pinskia at gcc dot gnu dot org
@ 2006-06-06 19:44 ` amacleod at redhat dot com
  2006-06-07  2:32 ` amacleod at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: amacleod at redhat dot com @ 2006-06-06 19:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from amacleod at redhat dot com  2006-06-06 19:41 -------
yes, this appears to fix PR 27894 as well.


-- 


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (16 preceding siblings ...)
  2006-06-06 19:44 ` amacleod at redhat dot com
@ 2006-06-07  2:32 ` amacleod at gcc dot gnu dot org
  2006-06-08  1:24 ` amacleod at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: amacleod at gcc dot gnu dot org @ 2006-06-07  2:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from amacleod at redhat dot com  2006-06-07 00:51 -------
Subject: Bug 27793

Author: amacleod
Date: Wed Jun  7 00:51:27 2006
New Revision: 114458

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114458
Log:
2006-06-06  Andrew MacLeod  <amacleod@redhat.com>

        PR middle-end/27793
        * tree-dfa.c (referenced_vars_dup_list): New.  List of duplicate 
        referenced_variables with matching DECL_UID's.
        (find_referenced_vars): Make sure duplicate list is empty to start.
        (add_referenced_var): Add var to duplicate list if required.
        * tree-ssa.c (delete_tree_ssa): Clear var_ann's on duplicates.
        * tree-flow.h (referenced_vars_dup_list): External declaration.


Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/tree-dfa.c
    branches/gcc-4_1-branch/gcc/tree-flow.h
    branches/gcc-4_1-branch/gcc/tree-ssa.c


-- 


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (17 preceding siblings ...)
  2006-06-07  2:32 ` amacleod at gcc dot gnu dot org
@ 2006-06-08  1:24 ` amacleod at gcc dot gnu dot org
  2006-06-08 14:20 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: amacleod at gcc dot gnu dot org @ 2006-06-08  1:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from amacleod at redhat dot com  2006-06-08 01:18 -------
Subject: Bug 27793

Author: amacleod
Date: Thu Jun  8 01:18:16 2006
New Revision: 114480

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114480
Log:

2006-06-07  Andrew MacLeod  <amacleod@redhat.com>

        PR middle-end/27793
        * tree-dfa.c (referenced_vars_dup_list): New.  List of duplicate 
        referenced_variables with matching DECL_UID's.
        (find_referenced_vars): Make sure duplicate list is empty to start.
        (referenced_var_p): Remove.
        (referenced_var_check_and_insert): Renamed from referenced_var_insert.  
        Check if var is in the list, and add if needed.  Update the duplicate
        list if a different var is in the list with the same DECL_UID.
        (add_referenced_var): Call routine to check and insert.
        * tree-ssa.c (delete_tree_ssa): Clear var_ann's on duplicates.
        * tree-flow.h (referenced_vars_dup_list): External declaration.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-dfa.c
    trunk/gcc/tree-flow.h
    trunk/gcc/tree-ssa.c


-- 


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (18 preceding siblings ...)
  2006-06-08  1:24 ` amacleod at gcc dot gnu dot org
@ 2006-06-08 14:20 ` rguenth at gcc dot gnu dot org
  2006-06-13  9:22 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-06-08 14:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from rguenth at gcc dot gnu dot org  2006-06-08 14:17 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (19 preceding siblings ...)
  2006-06-08 14:20 ` rguenth at gcc dot gnu dot org
@ 2006-06-13  9:22 ` jakub at gcc dot gnu dot org
  2006-06-15 13:31 ` amacleod at gcc dot gnu dot org
  2006-08-13 19:27 ` jakub at gcc dot gnu dot org
  22 siblings, 0 replies; 24+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-06-13  9:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from jakub at gcc dot gnu dot org  2006-06-13 09:21 -------
Subject: Bug 27793

Author: jakub
Date: Tue Jun 13 09:21:30 2006
New Revision: 114607

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114607
Log:
        PR middle-end/27793
        * cp-tree.h (cxx_int_tree_map): New struct.
        (struct language_function): Add extern_decl_map field.
        * name-lookup.c (pushdecl_maybe_friend): Add x -> t mapping
        to cp_function_chain->extern_decl_map hash table instead of
        copying over DECL_UID.
        * cp-gimplify.c (cxx_int_tree_map_eq, cxx_int_tree_map_hash): New
        functions.
        (cp_genericize_r): Remap DECL_EXTERN local decls using
        cp_function_chain->extern_decl_map hash table.
        * decl.c (finish_function): Clear extern_decl_map.

        PR c++/26757
        PR c++/27894
        * g++.dg/tree-ssa/pr26757.C: New test.
        * g++.dg/tree-ssa/pr27894.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/tree-ssa/pr26757.C
    trunk/gcc/testsuite/g++.dg/tree-ssa/pr27894.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-gimplify.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (20 preceding siblings ...)
  2006-06-13  9:22 ` jakub at gcc dot gnu dot org
@ 2006-06-15 13:31 ` amacleod at gcc dot gnu dot org
  2006-08-13 19:27 ` jakub at gcc dot gnu dot org
  22 siblings, 0 replies; 24+ messages in thread
From: amacleod at gcc dot gnu dot org @ 2006-06-15 13:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from amacleod at redhat dot com  2006-06-15 13:30 -------
Subject: Bug 27793

Author: amacleod
Date: Thu Jun 15 13:30:17 2006
New Revision: 114678

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114678
Log:

2006-06-15  Andrew MacLeod  <amacleod@redhat.com>

        PR middle-end/27793
        * tree-dfa.c (referenced_vars_dup_list): Remove.
        (find_referenced_vars): Remove assert.
        (referenced_var_check_and_insert): Replace dup list with assert.
        * tree-ssa.c (delete_tree_ssa): Remove dup list processing.
        * tree-flow.h (referenced_vars_dup_list): Remove extern decl.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-dfa.c
    trunk/gcc/tree-flow.h
    trunk/gcc/tree-ssa.c


-- 


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


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

* [Bug middle-end/27793] [4.1 Regression] num_ssa_names inconsistent or immediate use iterator wrong
  2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
                   ` (21 preceding siblings ...)
  2006-06-15 13:31 ` amacleod at gcc dot gnu dot org
@ 2006-08-13 19:27 ` jakub at gcc dot gnu dot org
  22 siblings, 0 replies; 24+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-08-13 19:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from jakub at gcc dot gnu dot org  2006-08-13 19:26 -------
Subject: Bug 27793

Author: jakub
Date: Sun Aug 13 20:26:38 2006
New Revision: 116115

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116115
Log:
2006-08-13  Andrew MacLeod  <amacleod@redhat.com>

        PR middle-end/27793
        * tree-dfa.c (add_referenced_var): Assert DECL_UID is unique for
        different decls.

2006-08-13  Jakub Jelinek  <jakub@redhat.com>

        PR c++/28677
        PR middle-end/27793
        * cp-tree.h (cxx_int_tree_map): New struct.
        (struct language_function): Add extern_decl_map field.
        * name-lookup.c (pushdecl_maybe_friend): Add x -> t mapping
        to cp_function_chain->extern_decl_map hash table instead of
        copying over DECL_UID.
        * cp-gimplify.c (cxx_int_tree_map_eq, cxx_int_tree_map_hash): New
        functions.
        (cp_genericize_r): Remap DECL_EXTERN local decls using
        cp_function_chain->extern_decl_map hash table.
        * decl.c (finish_function): Clear extern_decl_map.

        Revert:
        2006-06-06  Andrew MacLeod  <amacleod@redhat.com>
        PR middle-end/27793
        * tree-dfa.c (referenced_vars_dup_list): New.  List of duplicate 
        referenced_variables with matching DECL_UID's.
        (find_referenced_vars): Make sure duplicate list is empty to start.
        (add_referenced_var): Add var to duplicate list if required.
        * tree-ssa.c (delete_tree_ssa): Clear var_ann's on duplicates.
        * tree-flow.h (referenced_vars_dup_list): External declaration.

        PR c++/26757
        PR c++/27894
        * g++.dg/tree-ssa/pr26757.C: New test.
        * g++.dg/tree-ssa/pr27894.C: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tree-ssa/pr26757.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tree-ssa/pr27894.C
Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/cp-gimplify.c
    branches/gcc-4_1-branch/gcc/cp/cp-tree.h
    branches/gcc-4_1-branch/gcc/cp/decl.c
    branches/gcc-4_1-branch/gcc/cp/name-lookup.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/tree-dfa.c
    branches/gcc-4_1-branch/gcc/tree-flow.h
    branches/gcc-4_1-branch/gcc/tree-ssa.c


-- 


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


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

end of thread, other threads:[~2006-08-13 19:27 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-29 10:47 [Bug middle-end/27793] New: num_ssa_names inconsistent or immediate use iterator wrong rguenth at gcc dot gnu dot org
2006-05-29 10:47 ` [Bug middle-end/27793] " rguenth at gcc dot gnu dot org
2006-05-29 10:48 ` rguenth at gcc dot gnu dot org
2006-05-29 12:43 ` rguenth at gcc dot gnu dot org
2006-05-29 13:17 ` rguenth at gcc dot gnu dot org
2006-05-29 13:46 ` rguenth at gcc dot gnu dot org
2006-05-29 14:05 ` rguenth at gcc dot gnu dot org
2006-05-29 14:09 ` [Bug middle-end/27793] [4.1 Regression] " rguenth at gcc dot gnu dot org
2006-05-29 14:15 ` rguenth at gcc dot gnu dot org
2006-05-29 14:19 ` rguenth at gcc dot gnu dot org
2006-05-29 16:14 ` pinskia at gcc dot gnu dot org
2006-05-30 22:05 ` amacleod at redhat dot com
2006-06-01 11:48 ` jakub at gcc dot gnu dot org
2006-06-01 14:59 ` mark at codesourcery dot com
2006-06-06 15:02 ` amacleod at redhat dot com
2006-06-06 16:57 ` mark at codesourcery dot com
2006-06-06 19:10 ` pinskia at gcc dot gnu dot org
2006-06-06 19:44 ` amacleod at redhat dot com
2006-06-07  2:32 ` amacleod at gcc dot gnu dot org
2006-06-08  1:24 ` amacleod at gcc dot gnu dot org
2006-06-08 14:20 ` rguenth at gcc dot gnu dot org
2006-06-13  9:22 ` jakub at gcc dot gnu dot org
2006-06-15 13:31 ` amacleod at gcc dot gnu dot org
2006-08-13 19:27 ` jakub 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).