https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127589
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Using nvptx and gcn as host compiler (cc1) causes the following fail as
expected:
error: ‘_Float16’ is not supported on this target
With _Float128 and offloading there is the error:
lto1: fatal error: nvptx-none - 128-bit-precision floating-point numbers
unsupported (mode ‘TF’)
Testcase - either with _Float16 or with _Float128, the latter prints the error
above - the former (as shown) gives an ICE:
int f(_Float16 x) {
return x > 0.0;
}
int main() {
int r;
_Float16 y = (_Float16)0.0;
#pragma omp target map(from: r), map(to: y)
r = f(y);
return r;
}
Namely, the ICE:
lto1: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in lto_fixup_prevailing_type, at
lto/lto-common.cc:1006
0x21d307f internal_error(char const*, ...)
/home/tob/repos/gcc/gcc/diagnostic-global-context.cc:787
0x7e6118 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/home/tob/repos/gcc/gcc/tree.cc:9297
0x69cb9e tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/home/tob/repos/gcc/gcc/tree.h:3986
0x69cb9e lto_fixup_prevailing_type
/home/tob/repos/gcc/gcc/lto/lto-common.cc:1006
0x69cb9e process_new_tree
/home/tob/repos/gcc/gcc/lto/lto-common.cc:1845
0x999f65 lto_read_decls
/home/tob/repos/gcc/gcc/lto/lto-common.cc:1966
0x999f65 lto_file_finalize
/home/tob/repos/gcc/gcc/lto/lto-common.cc:2351
0x999f65 lto_create_files_from_ids
/home/tob/repos/gcc/gcc/lto/lto-common.cc:2361
0x999f65 lto_file_read
/home/tob/repos/gcc/gcc/lto/lto-common.cc:2417
0x99acd3 read_cgraph_and_symbols(unsigned int, char const**)
/home/tob/repos/gcc/gcc/lto/lto-common.cc:2898
0x97ae38 lto_main()
/home/tob/repos/gcc/gcc/lto/lto.cc:693
* * *
The _Float128 error is printed via gcc/lto-streamer-in.cc's
lto_input_mode_table (struct lto_file_decl_data *file_data)
which has:
default:
/* This is only used for offloading-target compilations and
is a user-facing error. Give a better error message for
the common modes; see also mode-classes.def. */
if (mclass == MODE_FLOAT)
fatal_error (UNKNOWN_LOCATION,
"%s - %u-bit-precision floating-point numbers "
"unsupported (mode %qs)", TARGET_MACHINE,
prec.to_constant (), mname);
...
but this does not seem to trigger here, unfortunately.