On Tue, Nov 10, 2020 at 03:15:00PM +0100, Thomas Schwinge wrote: > Hi! > > On 2020-08-10T17:30:21-0400, Marek Polacek via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > This patch adds a new DejaGNU directive, dg-ice, as outlined in the > > proposal here: > > https://gcc.gnu.org/pipermail/gcc-patches/2020-July/550913.html > > > > It means that it's expected that the compiler crashes with an internal > > compiler error when compiling test with such a directive. > > Thanks, I find this useful.
Glad you find it useful! > So I have a testcase that currently ICEs... ;-) > > spawn -ignore SIGHUP [xgcc] > during GIMPLE pass: omplower > In file included from [...]:4: > [...]: In function 'f_data': > [...]:41:10: internal compiler error: in lower_omp_target, at > omp-low.c:11890 > [backtrace] > Please submit a full bug report, > with preprocessed source if appropriate. > Please include the complete backtrace with any bug report. > See <https://gcc.gnu.org/bugs/> for instructions. > compiler exited with status 1 > > I put '{ dg-ice }' into it, and do get the expected: > > XFAIL: [...] (internal compiler error)' > > But I also get an unexpected: > > FAIL: [...] (test for excess errors)' > > That's because of: > > Excess errors: > during GIMPLE pass: omplower > > I can easily '{ dg-prune-output "during GIMPLE pass: omplower" }', of > course, or should this lead-in be pruned internally, automatically? I think prune_ices should prune this automatically. Want me to submit a patch for that? > And then, this is a '{ dg-do run }' testcase, I see: > > UNRESOLVED: > libgomp.oacc-c/../libgomp.oacc-c-c++-common/declare-vla-kernels-decompose.c > -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O0 > compilation failed to produce executable > > Given '{ dg-ice }', it's obvious that we don't get an executable to run. Yup. > I thought that maybe '{ dg-ice }' testcases should automatically be > demoted into '{ dg-do compile }', but that would be wrong for link-time > ICEs. But can we "expect" the UNRESOLVED, and turn that into another > XFAIL? Aha, actually I see that for '{ dg-do link }', this seems to > behave as expected (no UNRESOLVED), so we might demote all '{ dg-ice }' > testcases from '{ dg-do run }' to '{ dg-do link }', if that makes sense? I think the dg-ice directive shouldn't change whether the test is dg-do compile/run/link/assemble or something else. Probably best to use { dg-do link } if that works, and leave a comment that after fixing the ICE the test should be turned into dg-do run, if that is what's desired. Marek