Commit c80c9e26 by Tobias Burnus

PR 86416 – improve lto1 diagnostic if a mode does not exist

        PR middle-end/86416
        *  Makefile.in (CFLAGS-lto-streamer-in.o): Pass target_noncanonical on.
        * lto-streamer-in.c (lto_input_mode_table): Improve unsupported-mode
        diagnostic.

        PR middle-end/86416
        * testsuite/libgomp.c/pr86416-1.c: New.
        * testsuite/libgomp.c/pr86416-2.c: New.

From-SVN: r279528
parent 6573d760
2019-12-18 Tobias Burnus <tobias@codesourcery.com>
PR middle-end/86416
* Makefile.in (CFLAGS-lto-streamer-in.o): Pass target_noncanonical on.
* lto-streamer-in.c (lto_input_mode_table): Improve unsupported-mode
diagnostic.
2019-12-18 Wilco Dijkstra <wdijkstr@arm.com> 2019-12-18 Wilco Dijkstra <wdijkstr@arm.com>
* config/aarch64/aarch64-cores.def: * config/aarch64/aarch64-cores.def:
...@@ -11,7 +18,7 @@ ...@@ -11,7 +18,7 @@
PR ipa/92971 PR ipa/92971
* ipa-cp.c (cgraph_edge_brings_all_agg_vals_for_node): Fix * ipa-cp.c (cgraph_edge_brings_all_agg_vals_for_node): Fix
definition of values, release memory on exit. definition of values, release memory on exit.
2019-12-17 Jan Hubicka <hubicka@ucw.cz> 2019-12-17 Jan Hubicka <hubicka@ucw.cz>
Martin Jambor <mjambor@suse.cz> Martin Jambor <mjambor@suse.cz>
...@@ -2244,6 +2244,8 @@ version.o: $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE) ...@@ -2244,6 +2244,8 @@ version.o: $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
# lto-compress.o needs $(ZLIBINC) added to the include flags. # lto-compress.o needs $(ZLIBINC) added to the include flags.
CFLAGS-lto-compress.o += $(ZLIBINC) CFLAGS-lto-compress.o += $(ZLIBINC)
CFLAGS-lto-streamer-in.o += -DTARGET_MACHINE=\"$(target_noncanonical)\"
bversion.h: s-bversion; @true bversion.h: s-bversion; @true
s-bversion: BASE-VER s-bversion: BASE-VER
echo "#define BUILDING_GCC_MAJOR `echo $(BASEVER_c) | sed -e 's/^\([0-9]*\).*$$/\1/'`" > bversion.h echo "#define BUILDING_GCC_MAJOR `echo $(BASEVER_c) | sed -e 's/^\([0-9]*\).*$$/\1/'`" > bversion.h
......
...@@ -1698,7 +1698,31 @@ lto_input_mode_table (struct lto_file_decl_data *file_data) ...@@ -1698,7 +1698,31 @@ lto_input_mode_table (struct lto_file_decl_data *file_data)
} }
/* FALLTHRU */ /* FALLTHRU */
default: default:
fatal_error (UNKNOWN_LOCATION, "unsupported mode %qs", mname); /* 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);
else if (mclass == MODE_DECIMAL_FLOAT)
fatal_error (UNKNOWN_LOCATION,
"%s - %u-bit-precision decimal floating-point "
"numbers unsupported (mode %qs)", TARGET_MACHINE,
prec.to_constant (), mname);
else if (mclass == MODE_COMPLEX_FLOAT)
fatal_error (UNKNOWN_LOCATION,
"%s - %u-bit-precision complex floating-point "
"numbers unsupported (mode %qs)", TARGET_MACHINE,
prec.to_constant (), mname);
else if (mclass == MODE_INT)
fatal_error (UNKNOWN_LOCATION,
"%s - %u-bit integer numbers unsupported (mode "
"%qs)", TARGET_MACHINE, prec.to_constant (), mname);
else
fatal_error (UNKNOWN_LOCATION, "%s - unsupported mode %qs",
TARGET_MACHINE, mname);
break; break;
} }
} }
......
2019-12-18 Tobias Burnus <tobias@codesourcery.com>
PR middle-end/86416
* testsuite/libgomp.c/pr86416-1.c: New.
* testsuite/libgomp.c/pr86416-2.c: New.
2019-12-17 Tobias Burnus <tobias@codesourcery.com> 2019-12-17 Tobias Burnus <tobias@codesourcery.com>
* config/accel/openacc.f90 (module openacc_kinds): Use 'PUBLIC' to mark * config/accel/openacc.f90 (module openacc_kinds): Use 'PUBLIC' to mark
......
/* { dg-do link } */
/* { dg-require-effective-target large_long_double } */
/* PR middle-end/86416 */
/* { dg-error "bit-precision floating-point numbers unsupported .mode '.F'." "" { target offload_device } 0 } */
/* { dg-excess-errors "Follow-up errors from mkoffload and lto-wrapper" { target offload_device } } */
#include <stdlib.h> /* For abort. */
long double foo (long double x)
{
#pragma omp target map(tofrom:x)
x *= 2.0;
return x;
}
int main()
{
long double v = foo (10.0q) - 20.0q;
if (v > 1.0e-5 || v < -1.0e-5) abort();
return 0;
}
/* { dg-do link { target __float128 } } */
/* { dg-add-options __float128 } */
/* PR middle-end/86416 */
/* { dg-error "bit-precision floating-point numbers unsupported .mode '.F'." "" { target offload_device } 0 } */
/* { dg-excess-errors "Follow-up errors from mkoffload and lto-wrapper" { target offload_device } } */
#include <stdlib.h> /* For abort. */
__float128 foo(__float128 y)
{
#pragma omp target map(tofrom: y)
y *= 4.0;
return y;
}
int main()
{
__float128 v = foo (5.0L) - 20.0L;
if (v > 1.0e-5 || v < -1.0e-5) abort();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment