> I wonder for example about > > <integer_type 0x2b1d770a3300 integer > type <integer_type 0x2b1d76cbe540 integer sizes-gimplified > asm_written public visited SI > size <integer_cst 0x2b1d76cb0a20 constant 32> > unit size <integer_cst 0x2b1d76cb0690 constant 4> > align 32 symtab 1993070176 alias set -1 canonical type > 0x2b1d76cbe540 precision 32 min <integer_cst 0x2b1d76cb0990 > -2147483648> max <integer_cst 0x2b1d76cb09c0 2147483647> > pointer_to_this <pointer_type 0x2b1d76ccc6c0>> > sizes-gimplified asm_written public visited SI size <integer_cst > 0x2b1d76cb0a20 32> unit size <integer_cst 0x2b1d76cb0690 4> > align 32 symtab 2001622336 alias set 0 canonical type > 0x2b1d770a3300 precision 32 min <integer_cst 0x2b1d76cb0990 > -2147483648> max <integer_cst 0x2b1d76cb09c0 2147483647> RM size > <integer_cst 0x2b1d76cb0a20 32> > chain <type_decl 0x2b1d770a33c0 integer>> > > it seems the base type here is exactly the same as the subtype?
Yes, don't be too surprised, gigi even creates extra subtypes (not present in the language) to work around its own quirks. :-) > In the particular case IVOPTs is creating arithmetic in that type. Or > maybe fold. Yes, IVOPTs does that. I needed this patchlet *************** generic_type_for (tree type) *** 1978,1983 **** --- 1978,1990 ---- if (POINTER_TYPE_P (type)) return ptr_type_node; + /* Return the appropriate type to do unsigned arithmetics. */ + if (TREE_CODE (type) == INTEGER_TYPE && TREE_TYPE (type)) + type = TREE_TYPE (type); + + if (TREE_CODE (type) != INTEGER_TYPE) + return lang_hooks.types.type_for_size (TYPE_PRECISION (type), 1); + if (TYPE_UNSIGNED (type)) return type; when I was experimenting with another approach to the subtype problem. -- Eric Botcazou