Jan Hubicka <hubi...@ucw.cz> writes: > Hi, > this patch extends verify_type to check various uses of TYPE_MINVAL. > I also added check that MIN_VALUE have compatible type with T: > useless_type_conversion_p (const_cast <tree> (t), TREE_TYPE (TYPE_MIN_VALUE > (t))) > but that one fails interesting ways for C sizetype. I will try to look > into this and thus this patch omits it. > > The main motivation is to check that various frontend overrides of TYPE_MINVAL > are under control. > > Bootstrapped/regtested x86_64-linux, will commit it as obvious.
Not obvious enough, it seems: this patch broke gnat.dg/lto* tests at least on i386-pc-solaris2.10. E.g. FAIL: gnat.dg/lto1.adb (test for excess errors) WARNING: gnat.dg/lto1.adb compilation failed to produce executable FAIL: gnat.dg/lto1.adb (test for excess errors) Excess errors: /vol/gcc/src/hg/trunk/solaris/gcc/testsuite/gnat.dg/lto1_pkg.adb:23:1: error: TYPE_MIN_VALUE is not constant <placeholder_expr feb2b9b0 type <integer_type fea16000 sizetype public unsigned SI size <integer_cst fea041cc constant 32> unit size <integer_cst fea041e0 constant 4> align 32 symtab 0 alias set -1 canonical type fea16000 precision 32 min <integer_cst fea041f4 0> max <integer_cst fea04000 4294967295>> > <integer_type feb67ba0 lto1_pkg__Tfiltering_levels_tB___UB0 type <integer_type fea16000 sizetype public unsigned SI size <integer_cst fea041cc constant 32> unit size <integer_cst fea041e0 constant 4> align 32 symtab 0 alias set -1 canonical type fea16000 precision 32 min <integer_cst fea041f4 0> max <integer_cst fea04000 4294967295>> sizes-gimplified visited SI size <integer_cst fea041cc 32> unit size <integer_cst fea041e0 4> align 32 symtab 0 alias set -1 canonical type feb67ba0 precision 32 min <placeholder_expr feb2b9b0> max <placeholder_expr feb2b9c0> index type <integer_type feb67b40 type <enumeral_type feb67960 lto1_pkg__filtering_level_t sizes-gimplified visited unsigned QI size <integer_cst fea042d0 constant 8> unit size <integer_cst fea042e4 constant 1> align 8 symtab 0 alias set -1 canonical type feb67960 precision 8 min <integer_cst feb60e4c 0> max <integer_cst feb60f3c 255> values <tree_list feb648e8 purpose <identifier_node feb639d8 lto1_pkg__none> value <integer_cst feb60e4c constant visited 0> chain <tree_list feb64918 purpose <identifier_node feb639f4 lto1_pkg__pr_in_clutter> value <integer_cst feb60f50 constant 1> chain <tree_list feb64930 purpose <identifier_node feb63a10 lto1_pkg__ssr_plots> value <integer_cst feb60f78 constant 2> chain <tree_list feb64948 purpose <identifier_node feb63a2c lto1_pkg__pr_plots> value <integer_cst feb60fa0 3>>>>> context <translation_unit_decl fed805f0 D.18> chain <type_decl feb687e8 lto1_pkg__filtering_level_t>> QI size <integer_cst fea042d0 8> unit size <integer_cst fea042e4 1> align 8 symtab 0 alias set -1 canonical type feb67b40 precision 8 min <integer_cst feb60e4c 0> max <integer_cst feb60fa0 3> RM min <component_ref feb63a9c> RM max <component_ref feb63ab8>> chain <type_decl feb68a10 D.4194>> Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University