Bug 44831 - [4.6 Regression] internal compiler error: verify_stmts failed when compiling wine
Summary: [4.6 Regression] internal compiler error: verify_stmts failed when compiling ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Richard Biener
URL:
Keywords:
: 44866 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-07-06 01:06 UTC by austinenglish
Modified: 2010-07-08 11:39 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-07-06 10:30:03


Attachments
output of gcc -v -save-temps (1.14 KB, text/plain)
2010-07-06 01:06 UTC, austinenglish
Details
preproccessed .i file (30.65 KB, text/plain)
2010-07-06 01:08 UTC, austinenglish
Details

Note You need to log in before you can comment on or make changes to this bug.
Description austinenglish 2010-07-06 01:06:14 UTC
Howdy,

This is a regression in gcc, but I haven't yet bisected it. Hopefully there is enough information to fix it without bisecting.

gcc version used:
austin@midna:~/wine-git/dlls/netapi32$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure : (reconfigured) ./configure : (reconfigured) ./configure
Thread model: posix
gcc version 4.6.0 20100705 (experimental) (GCC) 

when compiling wine, it fails with:
austin@midna:~/wine-git/dlls/netapi32$ make
gcc -m32 -c -I. -I. -I../../include -I../../include  -D__WINESRC__ -D_SVRAPI_ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith  -g -O2  -o nbcmdqueue.o nbcmdqueue.c
nbcmdqueue.c: In function ‘NBCmdQueueFindNBC’:
nbcmdqueue.c:92:14: error: Incompatible types in PHI argument 1
struct _NCB *

UCHAR

D.10020_19 = PHI <D.10021_22(3), D.10022_23(4)>

nbcmdqueue.c:92:14: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [nbcmdqueue.o] Error 1

system is ubuntu lucid, uname -a:
Linux midna 2.6.31-11-rt #154-Ubuntu SMP PREEMPT RT Wed Jun 9 13:40:34 UTC 2010 x86_64 GNU/Linux

expected behavior: wine compiles
actual behavior: internal compiler error

I'll attach the output of gcc -v -save-temps as well as the preprocessed source.
Comment 1 austinenglish 2010-07-06 01:06:38 UTC
Created attachment 21097 [details]
output of gcc -v -save-temps
Comment 2 austinenglish 2010-07-06 01:08:37 UTC
Created attachment 21098 [details]
preproccessed .i file
Comment 3 Richard Biener 2010-07-06 10:30:03 UTC
Confirmed.  Reduced testcase:

typedef unsigned char UCHAR, *PUCHAR;
typedef void *HANDLE;
typedef struct _NCB {
    UCHAR ncb_reserve[10];
} NCB, *PNCB;
struct NBCmdQueue {
    PNCB head;
};
PNCB *NBCmdQueueFindNBC(struct NBCmdQueue *queue, PNCB ncb)
{
  PNCB *ret = &queue->head;
  while (ret && *ret != ncb)
    ret = (PNCB *)((*ret)->ncb_reserve + sizeof(HANDLE));
}

caused by phiprop.  Thus, mine.
Comment 4 Richard Biener 2010-07-08 10:41:23 UTC
*** Bug 44866 has been marked as a duplicate of this bug. ***
Comment 5 Richard Biener 2010-07-08 11:38:57 UTC
Subject: Bug 44831

Author: rguenth
Date: Thu Jul  8 11:38:43 2010
New Revision: 161950

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161950
Log:
2010-07-08  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/44831
	* tree-ssa-phiprop.c (phiprop_insert_phi): Properly build
	a MEM_REF preserving TBAA info of the original dereference.
	Dereference the original pointer if the address is not
	invariant.
	(propagate_with_phi): Fixup type checks wrt MEM_REFs.  Require
	at least one invariant address that we are going to dereference.

	* gcc.c-torture/compile/pr44831.c: New testcase.
	* gcc.dg/tree-ssa/pr21463.c: Adjust.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr44831.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr21463.c
    trunk/gcc/tree-ssa-phiprop.c

Comment 6 Richard Biener 2010-07-08 11:39:05 UTC
Fixed.