Bug 27103 - [4.2 Regression] ICE: tree check: expected ssa_name, have symbol_memory_tag in is_old_name, at tree-into-ssa.c:466
Summary: [4.2 Regression] ICE: tree check: expected ssa_name, have symbol_memory_tag i...
Status: RESOLVED DUPLICATE of bug 26490
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, monitored
Depends on: 26490
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-10 18:34 UTC by Debian GCC Maintainers
Modified: 2006-04-13 16:35 UTC (History)
5 users (show)

See Also:
Host: x86_64-linux-gnu
Target: x86_64-linux-gnu
Build: x86_64-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2006-04-13 12:00:20


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2006-04-10 18:34:45 UTC
[ forwarded from http://bugs.debian.org/361814 ]
falk@juist:/tmp% cat test.c       
typedef struct { int size; } gnutls_datum;
typedef struct gnutls_cert { gnutls_datum raw; } gnutls_cert;
typedef struct { } gnutls_privkey;

int _gnutls_log_level;
void _gnutls_log(void);
void _gnutls_write_datum24(char*, gnutls_datum);

void _gnutls_gen_x509_crt (gnutls_cert *apr_cert_list,
                           char *pdata) {
    if (_gnutls_log_level)
        _gnutls_log();
    _gnutls_write_datum24(pdata, apr_cert_list->raw);
    pdata += apr_cert_list->raw.size;
}

falk@juist:/tmp% gcc -c -O test.c 
falk@juist:/tmp% gcc-4.1 -c -O2 test.c 
falk@juist:/tmp% gcc -c -O2 test.c
test.c: In function '_gnutls_gen_x509_crt':
test.c:10: internal compiler error: tree check: expected ssa_name, have symbol_memory_tag in verify_ssa, at tree-ssa.c:776
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

    Falk
Comment 1 Andrew Pinski 2006-04-10 18:43:59 UTC
Related to PR 26490.
Comment 2 Andrew Pinski 2006-04-10 18:45:46 UTC
This works with "4.2.0 20060409".
Comment 3 Debian GCC Maintainers 2006-04-10 18:53:34 UTC
(In reply to comment #2)
> This works with "4.2.0 20060409".

Hmm. I get the ICE with 4.2.0 20060407. Will try a newer one...
Comment 4 Martin Michlmayr 2006-04-13 11:27:19 UTC
I can confirm that this test case works with 20060408.  However, a slightly longer test case (directly from delta, without Falk's manual reduction) still produces a segfault, but only when you pass -finline-functions:

(sid)127:tbm@deprecation: ~] cat m.c
typedef struct { unsigned int size; } gnutls_datum;
typedef struct gnutls_cert { gnutls_datum raw; } gnutls_cert;
typedef struct gnutls_privkey_int { } gnutls_privkey;
typedef struct gnutls_session_int *gnutls_session;
extern int _gnutls_log_level;

_gnutls_gen_x509_crt (gnutls_session session, unsigned char ** data)
{
  int ret, i;
  unsigned char *pdata;
  gnutls_cert *apr_cert_list;
  gnutls_privkey *apr_pkey;
  int apr_cert_list_length;
  if ((ret =
       _gnutls_get_selected_cert (session, &apr_cert_list,
                                  &apr_cert_list_length, &apr_pkey)) < 0)
    {
      if (_gnutls_log_level >= 2 || _gnutls_log_level > 9)
        _gnutls_log (2, "ASSERT: %s:%d\n", "auth_cert.c", 665);
    }
  for (i = 0; i < apr_cert_list_length; i++)
    {
      _gnutls_write_datum24 (pdata, apr_cert_list[i].raw);
      pdata += (3 + apr_cert_list[i].raw.size);
    }
}
_gnutls_get_selected_cert (gnutls_session session,
                           gnutls_privkey ** apr_pkey)
{
}

(sid)128:tbm@deprecation: ~] gcc-4.0 -O2 -c -finline-functions m.c
(sid)129:tbm@deprecation: ~] /usr/lib/gcc-snapshot/bin/gcc -O2 -c -finline-functions m.c
m.c: In function '_gnutls_gen_x509_crt':
m.c:8: internal compiler error: tree check: expected ssa_name, have symbol_memory_tag in verify_ssa, at tree-ssa.c:735
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
zsh: exit 1     /usr/lib/gcc-snapshot/bin/gcc -O2 -c -finline-functions m.c
(sid)130:tbm@deprecation: ~] /usr/lib/gcc-snapshot/bin/gcc -O2 -c  m.c
(sid)131:tbm@deprecation: ~]
Comment 5 Volker Reichelt 2006-04-13 12:00:20 UTC
Confirmed.

The original testcase compiles fine for me with today's compiler.
If I remove the (unused) typedef in the third line, I get the ICE.

Here's a reduced testcase:

=================================
struct A { int i; };
struct B { struct A a; };

int N;

void foo(struct B *p, char *q)
{
    if (N)
        bar(p->a, q);
    q += p->a.i;
}
=================================
Comment 6 Volker Reichelt 2006-04-13 12:01:10 UTC
Forgot to mention that you have to compile the testcase from comment #5
with "-O2".
Comment 7 Andrew Pinski 2006-04-13 16:35:43 UTC
This is the same as PR 26490.

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