ICE in get_constraint_for_component_ref
Mohamed Shafi
shafitvm@gmail.com
Thu Feb 10 11:42:00 GMT 2011
On 10 February 2011 15:57, Richard Guenther <richard.guenther@gmail.com> wrote:
> On Thu, Feb 10, 2011 at 6:23 AM, Mohamed Shafi <shafitvm@gmail.com> wrote:
>> Hi all,
>>
>> I am trying to port a private target in GCC 4.5.1. Following are the
>> properties of the target
>>
>> #define BITS_PER_UNIT 32
>> #define BITS_PER_WORD 32
>> #define UNITS_PER_WORD 1
>>
>>
>> #define CHAR_TYPE_SIZE 32
>> #define SHORT_TYPE_SIZE 32
>> #define INT_TYPE_SIZE 32
>> #define LONG_TYPE_SIZE 32
>> #define LONG_LONG_TYPE_SIZE 32
>>
>>
>>
>> I am getting an ICE
>> internal compiler error: in get_constraint_for_component_ref, at
>> tree-ssa-structalias.c:3031
>>
>> For the following testcase:
>>
>> struct fb_cmap {
>> int start;
>> int len;
>> int *green;
>> };
>>
>> extern struct fb_cmap fb_cmap;
>>
>> void directcolor_update_cmap(void)
>> {
>> fb_cmap.green[0] = 34;
>> }
>>
>> The following is the output of debug_tree of the argument thats given
>> for the function get_constraint_for_component_ref
>>
>> <component_ref 0x2b6a45618080
>> type <pointer_type 0x2b6a45559930
>> type <integer_type 0x2b6a4554a498 int public QI
>> size <integer_cst 0x2b6a4553c460 constant 32>
>> unit size <integer_cst 0x2b6a4553c488 constant 1>
>> align 32 symtab 0 alias set -1 canonical type
>> 0x2b6a4554a498 precision 32 min <integer_cst 0x2b6a4553c5c8
>> -2147483648> max <integer_cst 0x2b6a4553c5f0 2147483647>
>> pointer_to_this <pointer_type 0x2b6a45559930>>
>> unsigned PQI size <integer_cst 0x2b6a4553c460 32> unit size
>> <integer_cst 0x2b6a4553c488 1>
>> align 32 symtab 0 alias set -1 canonical type 0x2b6a45559930>
>>
>> arg 0 <var_decl 0x2b6a45614000 fb_cmap
>> type <record_type 0x2b6a45602888 fb_cmap type_0 BLK
>> size <integer_cst 0x2b6a455fc4d8 constant 96>
>> unit size <integer_cst 0x2b6a455fc488 constant 3>
>> align 32 symtab 0 alias set -1 canonical type
>> 0x2b6a45602888 fields <field_decl 0x2b6a45613000 start> context
>> <translation_unit_decl 0x2b6a4555f7e8 D.1201>
>> chain <type_decl 0x2b6a4555f730 D.1193>>
>> used public external common BLK file pr28675.c line 7 col 23
>> size <integer_cst 0x2b6a455fc4d8 96> unit size <integer_cst
>> 0x2b6a455fc488 3>
>> align 32
>> chain <function_decl 0x2b6a45616000 directcolor_update_cmap
>> type <function_type 0x2b6a45560888>
>> public static QI file pr28675.c line 9 col 6 align 32
>> initial <block 0x2b6a45619000> result <result_decl 0x2b6a45617000
>> D.1200>
>> (mem:QI (symbol_ref:PQI ("directcolor_update_cmap") [flags
>> 0x3] <function_decl 0x2b6a45616000 directcolor_update_cmap>) [0 S1
>> A32])
>> struct-function 0x2b6a455453f0>>
>> arg 1 <field_decl 0x2b6a45613130 green type <pointer_type 0x2b6a45559930>
>> unsigned PQI file pr28675.c line 4 col 7 size <integer_cst
>> 0x2b6a4553c460 32> unit size <integer_cst 0x2b6a4553c488 1>
>> align 32 offset_align 32
>> offset <integer_cst 0x2b6a4553c8c0 constant 2>
>> bit offset <integer_cst 0x2b6a4553cc80 constant 0> context
>> <record_type 0x2b6a45602888 fb_cmap>>
>> pr28675.c:11:10>
>>
>> I was wondering if this ICE is due to the fact that this is a 32bit
>> char target ? Can somebody help me with pointers to debug this issue?
>
> Try fixing the * 8 in bitpos_of_field to use BITS_PER_UNIT.
>
That did the trick. Looking at the code i assume that this is proper
and hence should be committed in the trunk and 4.5 branch. Will that
be done?
Shafi
More information about the Gcc
mailing list