Summary: | [4.3 Regression] ICE in bitfield_overlaps_p, at tree-sra.c:2901 | ||
---|---|---|---|
Product: | gcc | Reporter: | Richard Biener <rguenth> |
Component: | tree-optimization | Assignee: | Alexandre Oliva <aoliva> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aoliva, gcc-bugs, hjl.tools, wilson |
Priority: | P3 | Keywords: | ice-on-valid-code |
Version: | 4.3.0 | ||
Target Milestone: | 4.3.0 | ||
Host: | Target: | x86_64-*-* | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2007-10-05 15:24:19 | |
Attachments: |
testcase (unreduced)
add another conversion to bitsizetype |
Description
Richard Biener
2007-10-04 12:18:53 UTC
Created attachment 14295 [details]
testcase (unreduced)
Reducing.
Reduced testcase, fails with -O: typedef struct { unsigned long attr; int chars[2]; } cchar_t; typedef struct _win_st { cchar_t _bkgrnd; } WINDOW; void render_char(WINDOW *win, cchar_t ch) { if ((ch).chars[0] == L' ' && (ch).chars[1] == L'\0') ch = win->_bkgrnd; } #1 0x0000000000945da0 in bitfield_overlaps_p (blen=0x2b7db0ca8b70, bpos=0x2b7db0cc43c0, fld=0x13f66d0, data=0x7ffff9e5cfc0) at /space/rguenther/src/svn/pointer_plus/gcc/tree-sra.c:2901 2901 gcc_unreachable (); (gdb) call debug_tree (fld->element) <integer_cst 0x2b7db0ca8810 type <integer_type 0x2b7db0cb7000 long unsigned int> constant invariant 1> Testing patch at http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00298.html Subject: Bug 33655 Author: aoliva Date: Sat Oct 6 11:47:51 2007 New Revision: 129052 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129052 Log: gcc/ChangeLog: PR tree-optimization/33655 * tree-sra.c (bitfield_overlaps_p): Handle array and complex elements. gcc/testsuite/ChangeLog: PR tree-optimization/33655 * gcc.dg/torture/pr33655.c: New. Added: trunk/gcc/testsuite/gcc.dg/torture/pr33655.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-sra.c (In reply to comment #4) > Subject: Bug 33655 > > Author: aoliva > Date: Sat Oct 6 11:47:51 2007 > New Revision: 129052 > > URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129052 > Log: > gcc/ChangeLog: > PR tree-optimization/33655 > * tree-sra.c (bitfield_overlaps_p): Handle array and complex > elements. > gcc/testsuite/ChangeLog: > PR tree-optimization/33655 > * gcc.dg/torture/pr33655.c: New. > > Added: > trunk/gcc/testsuite/gcc.dg/torture/pr33655.c > Modified: > trunk/gcc/ChangeLog > trunk/gcc/testsuite/ChangeLog > trunk/gcc/tree-sra.c > This patch doesn't work on Linux/ia64. I got Executing on host: /export/build/gnu/gcc/build-ia64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-ia64-linux/gcc/ /net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/torture/pr33655.c -O1 -fno-show-column -S -o pr33655.s (timeout = 300) /net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/torture/pr33655.c: In function 'render_char':^M /net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/torture/pr33655.c:14: internal compiler error: in size_binop, at fold-const.c:2036^M Please submit a full bug report,^M with preprocessed source if appropriate.^M See <http://gcc.gnu.org/bugs.html> for instructions.^M Subject: Re: [4.3 Regression] ICE in bitfield_overlaps_p,
at tree-sra.c:2901
hjl at lucon dot org wrote:
> This patch doesn't work on Linux/ia64. I got
IA-64 is using a TImode bitsizetype because it defines
MAX_FIXED_MODE_SIZE to enable TImode. The x86_64 port does not, so it
ends up with a DImode bitsizetype and hence does not have the same
problem. It looks like a few other 64-bit ports will fail the same way
though, like powerpc64 and s390.
We can fix this with small patch to add another bitsizetype conversion
call. I'll attach a patch.
Created attachment 14324 [details]
add another conversion to bitsizetype
Here is an patch to fix the IA-64 failure for this testcase. This makes the testcase work (i.e. gcc doesn't ICE), but has not been otherwise tested as yet.
Subject: Bug 33655 Author: aoliva Date: Tue Oct 9 04:55:17 2007 New Revision: 129152 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129152 Log: PR tree-optimization/33655 PR middle-end/22156 * tree-sra.c (bitfield_overlaps_p): When fld->element is INTEGER_CST, convert it to bitsizetype before size_binop call. Modified: trunk/gcc/ChangeLog trunk/gcc/tree-sra.c Fixed |