Message ID | Pine.LNX.4.64.1204251539170.23071@jbgna.fhfr.qr |
---|---|
State | New |
Headers | show |
> Ah, and all ACATS fails and > > -FAIL: gnat.dg/loop_optimization3.adb (test for excess errors) > -FAIL: gnat.dg/loop_optimization3.adb execution test > -FAIL: gnat.dg/test_8bitlong_overflow.adb (test for excess errors) > -FAIL: gnat.dg/test_8bitlong_overflow.adb execution test > > are fixed by for example > > [...] > > thus are because array TYPE_DOMAIN is built using unsigned sizetype > but these Ada testcases have array domains which really need signed > types. The above is of course a hack, but one that otherwise survives > bootstrap / test of all languages. Kind of a miracle if you ask me, but probably a reasonable way out for Ada. Thanks a lot for devising it. > Thus, we arrive at the following Ada regression status if the patch series > is applied (plus the above incremental patch): > > === acats tests === > > === acats Summary === > # of expected passes 2320 > # of unexpected failures 0 > Native configuration is x86_64-unknown-linux-gnu > > === gnat tests === > > > Running target unix/ > FAIL: gnat.dg/array11.adb (test for warnings, line 12) > FAIL: gnat.dg/object_overflow.adb (test for warnings, line 8) > FAIL: gnat.dg/renaming5.adb scan-tree-dump-times optimized "goto" 2 > FAIL: gnat.dg/return3.adb scan-assembler loc 1 6 > > === gnat Summary for unix/ === > > # of expected passes 1093 > # of unexpected failures 4 > # of expected failures 13 > # of unsupported tests 2 > > Running target unix//-m32 > FAIL: gnat.dg/array11.adb (test for warnings, line 12) > FAIL: gnat.dg/object_overflow.adb (test for warnings, line 8) > FAIL: gnat.dg/renaming5.adb scan-tree-dump-times optimized "goto" 2 > FAIL: gnat.dg/return3.adb scan-assembler loc 1 6 > > === gnat Summary for unix//-m32 === > > # of expected passes 1093 > # of unexpected failures 4 > # of expected failures 13 > # of unsupported tests 2 > > === gnat Summary === > > # of expected passes 2186 > # of unexpected failures 8 > # of expected failures 26 > # of unsupported tests 4 > > > Which I consider reasonable? Sure, no opposition by me to applying the whole set of patches.
On Fri, 27 Apr 2012, Eric Botcazou wrote: > > Ah, and all ACATS fails and > > > > -FAIL: gnat.dg/loop_optimization3.adb (test for excess errors) > > -FAIL: gnat.dg/loop_optimization3.adb execution test > > -FAIL: gnat.dg/test_8bitlong_overflow.adb (test for excess errors) > > -FAIL: gnat.dg/test_8bitlong_overflow.adb execution test > > > > are fixed by for example > > > > [...] > > > > thus are because array TYPE_DOMAIN is built using unsigned sizetype > > but these Ada testcases have array domains which really need signed > > types. The above is of course a hack, but one that otherwise survives > > bootstrap / test of all languages. > > Kind of a miracle if you ask me, but probably a reasonable way out for Ada. > Thanks a lot for devising it. > > > Thus, we arrive at the following Ada regression status if the patch series > > is applied (plus the above incremental patch): > > > > === acats tests === > > > > === acats Summary === > > # of expected passes 2320 > > # of unexpected failures 0 > > Native configuration is x86_64-unknown-linux-gnu > > > > === gnat tests === > > > > > > Running target unix/ > > FAIL: gnat.dg/array11.adb (test for warnings, line 12) > > FAIL: gnat.dg/object_overflow.adb (test for warnings, line 8) > > FAIL: gnat.dg/renaming5.adb scan-tree-dump-times optimized "goto" 2 > > FAIL: gnat.dg/return3.adb scan-assembler loc 1 6 > > > > === gnat Summary for unix/ === > > > > # of expected passes 1093 > > # of unexpected failures 4 > > # of expected failures 13 > > # of unsupported tests 2 > > > > Running target unix//-m32 > > FAIL: gnat.dg/array11.adb (test for warnings, line 12) > > FAIL: gnat.dg/object_overflow.adb (test for warnings, line 8) > > FAIL: gnat.dg/renaming5.adb scan-tree-dump-times optimized "goto" 2 > > FAIL: gnat.dg/return3.adb scan-assembler loc 1 6 > > > > === gnat Summary for unix//-m32 === > > > > # of expected passes 1093 > > # of unexpected failures 4 > > # of expected failures 13 > > # of unsupported tests 2 > > > > === gnat Summary === > > > > # of expected passes 2186 > > # of unexpected failures 8 > > # of expected failures 26 > > # of unsupported tests 4 > > > > > > Which I consider reasonable? > > Sure, no opposition by me to applying the whole set of patches. Done now. Thanks, Richard.
Index: trunk/gcc/stor-layout.c =================================================================== --- trunk.orig/gcc/stor-layout.c 2012-04-25 14:14:52.321710059 +0200 +++ trunk/gcc/stor-layout.c 2012-04-25 14:13:43.595714163 +0200 @@ -2182,11 +2182,29 @@ layout_type (tree type) that (possible) negative values are handled appropriately when determining overflow. */ else - length - = fold_convert (sizetype, - size_binop (PLUS_EXPR, - build_int_cst (TREE_TYPE (lb), 1), - size_binop (MINUS_EXPR, ub, lb))); + { + /* ??? When it is obvious that the range is signed + represent it using ssizetype. */ + if (TREE_CODE (lb) == INTEGER_CST + && TREE_CODE (ub) == INTEGER_CST + && TYPE_UNSIGNED (TREE_TYPE (lb)) + && tree_int_cst_lt (ub, lb)) + { + lb = double_int_to_tree + (ssizetype, + double_int_sext (tree_to_double_int (lb), + TYPE_PRECISION (TREE_TYPE (lb)))); + ub = double_int_to_tree + (ssizetype, + double_int_sext (tree_to_double_int (ub), + TYPE_PRECISION (TREE_TYPE (ub)))); + } + length + = fold_convert (sizetype, + size_binop (PLUS_EXPR, + build_int_cst (TREE_TYPE (lb), 1), + size_binop (MINUS_EXPR, ub, lb))); + } /* If we arrived at a length of zero ignore any overflow that occured as part of the calculation. There exists