typedef struct _IO_FILE FILE; typedef unsigned long potrace_word; struct potrace_bitmap_s { int dy; potrace_word *map; }; typedef struct potrace_bitmap_s potrace_bitmap_t; struct bmp_info_s { unsigned int w; unsigned int h; unsigned int bits; unsigned int comp; }; typedef struct bmp_info_s bmp_info_t; static int bm_readbody_bmp(FILE *f, double threshold, potrace_bitmap_t **bmp) { bmp_info_t bmpinfo; unsigned int b; unsigned int i; potrace_bitmap_t *bm; int mask; unsigned int y; int col1[2]; if (col1[0] < col1[1]) mask = 0xff; else mask = 0; for (y=0; y<bmpinfo.h; y++) for (i=0; i<bmpinfo.w; i++) { b ^= mask; *(bm->map + y*bm->dy) |= (potrace_word)b << i; } return -1; } int bm_read(FILE *f, double threshold, potrace_bitmap_t **bmp, int *magic) { if (magic[0] == 'B' && magic[1] == 'M') return bm_readbody_bmp(f, threshold, bmp); return 0; }
ICEs with ./cc1 -quiet bitmap_io.min.i -O bitmap_io.min.i: In function 'bm_read': bitmap_io.min.i:41: internal compiler error: in trunc_int_for_mode, at explow.c:56 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. 56 gcc_assert (SCALAR_INT_MODE_P (mode)); #1 0x00000000005c0bd3 in trunc_int_for_mode (c=255, mode=CCmode) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/explow.c:56 #2 0x00000000005ae2b0 in gen_int_mode (c=255, mode=CCmode) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/emit-rtl.c:404 #3 0x000000000079e4e7 in simplify_binary_operation_1 (code=AND, mode=DImode, op0=0x2b2c79301190, op1=0x2b2c78e6cae0, trueop0=0x2b2c79301190, trueop1=0x2b2c78e6cae0) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/simplify-rtx.c:2224 #4 0x000000000079b76d in simplify_binary_operation (code=AND, mode=DImode, op0=0x2b2c79301190, op1=0x2b2c78e6cae0) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/simplify-rtx.c:1473 #5 0x0000000000797e7f in simplify_gen_binary (code=AND, mode=DImode, op0=0x2b2c79301190, op1=0x2b2c78e6cae0) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/simplify-rtx.c:119 #6 0x00000000008bac56 in simplify_and_const_int (x=0x0, mode=DImode, varop=0x2b2c79301190, constop=255) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/combine.c:8247 #7 0x00000000008bd00e in simplify_shift_const_1 (code=LSHIFTRT, result_mode=DImode, varop=0x2b2c79301190, orig_count=56) #8 0x00000000008bd0e4 in simplify_shift_const (x=0x0, code=LSHIFTRT, result_mode=DImode, varop=0x2b2c79300d60, count=56) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/combine.c:9275 #9 0x00000000008b44f3 in expand_compound_operation (x=0x2b2c79301180) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/combine.c:5779 #10 0x00000000008b7267 in force_to_mode (x=0x2b2c79301180, mode=DImode, mask=18446744073709551615, just_select=0) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/combine.c:6910 #11 0x00000000008b2969 in simplify_set (x=0x2b2c792fde20) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/combine.c:5186 #12 0x00000000008b127e in combine_simplify_rtx (x=0x2b2c792fde20, op0_mode=VOIDmode, in_dest=0) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/combine.c:4800 #13 0x00000000008af5ad in subst (x=0x2b2c792fde20, from=0x2b2c792fc020, to=0x2b2c79300b60, in_dest=0, unique_copy=0) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/combine.c:4131 #14 0x00000000008ae6b7 in subst (x=0x2b2c793010a0, from=0x2b2c792fc020, to=0x2b2c79300b60, in_dest=0, unique_copy=0) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/combine.c:4008 #15 0x00000000008a9475 in try_combine (i3=0x2b2c792f99b0, i2=0x2b2c792f9960, i1=0x2b2c792f9870, new_direct_jump_p=0x7fff31d5a7bc) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/combine.c:2386 #16 0x00000000008a50ef in combine_instructions (f=0x2b2c792d86c0, nregs=170) at /space/rguenther/src/svn/gcc-4_2-branch/gcc/combine.c:845 #17 0x00000000008c5138 in rest_of_handle_combine () at /space/rguenther/src/svn/gcc-4_2-branch/gcc/combine.c:12614 -- Summary: [4.2 Regresion] ICE in trunc_int_for_mode, at explow.c:56 during combine Product: gcc Version: 4.2.2 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: major Priority: P3 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org GCC target triplet: powerpc64-*-* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33148