I am working on a vector shifting patch, http://gcc.gnu.org/ml/gcc-patches/2010-06/msg01511.html and I noticed the following effect. When I compile the code with "-O -g", then the compiler crashes with an error: "internal compiler error: in simplify_subreg, at simplify-rtx.c:5128".
If I use -On or -g separately, the compilation works fine. It also works fine with -On -g -fno-var-tracking-assignments. The unpreprocessed code: /* dg-do run */ #define vector(elcount, type) \ __attribute__((vector_size((elcount)*sizeof(type)))) type #define vidx(type, vec, idx) (*((type *) &(vec) + idx)) #define uchar unsigned char #define ch14 1,2,3,4 #define ch1 1,1,1,1 int main (int argc, char *argv[]) { vector(16, uchar) vuchar = { ch14, ch14, ch14, ch14}; vector(16, char) vchar0 = { ch1, ch1, ch1, ch1}; vector(16, uchar) u1; u1 = vuchar << vchar0; if (vidx(char, u1, 0) != ((uchar)1 << (char)1)) __builtin_abort (); vuchar <<= vchar0; return 0; } Compilation process: t...@tema-notebook:~/phd/gcc/host-x86_64-unknown-linux-gnu/gcc$ ./xgcc -Wall -B. -O -g vector-shift3.c -fdump-tree-all -save-temps vector-shift3.c: In function main: vector-shift3.c:23:1: internal compiler error: in simplify_subreg, at simplify-rtx.c:5128 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. The *.i file: # 1 "vector-shift3.c" # 1 "/home/tema/phd/gcc/host-x86_64-unknown-linux-gnu/gcc//" # 1 "<built-in>" # 1 "<command-line>" # 1 "vector-shift3.c" # 11 "vector-shift3.c" int main (int argc, char *argv[]) { __attribute__((vector_size((16)*sizeof(unsigned char)))) unsigned char vuchar = { 1,2,3,4, 1,2,3,4, 1,2,3,4, 1,2,3,4}; __attribute__((vector_size((16)*sizeof(char)))) char vchar0 = { 1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1}; __attribute__((vector_size((16)*sizeof(unsigned char)))) unsigned char u1; u1 = vuchar << vchar0; if ((*((char *) &(u1) + 0)) != ((unsigned char)1 << (char)1)) __builtin_abort (); vuchar <<= vchar0; return 0; } The new patch should not affect this place. The problem is that I cannot repeat this behaviour without the interface changes in my patch. I'm ready to look into it, but I don't have knowledge in this part of the compiler. -- Summary: Debug statements passed to rtx Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: artyom dot shinkaroff at gmail dot com GCC build triplet: xgcc (GCC) 4.6.0 20100610 (experimental) GCC host triplet: host-x86_64-unknown GCC target triplet: linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44569