[ 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
Related to PR 26490.
This works with "4.2.0 20060409".
(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...
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: ~]
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; } =================================
Forgot to mention that you have to compile the testcase from comment #5 with "-O2".
This is the same as PR 26490. *** This bug has been marked as a duplicate of 26490 ***