Commit ee3a999f by Jakub Jelinek

re PR sanitizer/85029 (-fsanitize=undefined internal compiler error: in…

re PR sanitizer/85029 (-fsanitize=undefined internal compiler error: in maybe_optimize_ubsan_ptr_ifn, at sanopt.c:493)

	PR sanitizer/85029
	* sanopt.c (maybe_optimize_ubsan_ptr_ifn): If DECL_REGISTER (base),
	just don't try to optimize it rather than assert it never happens.

	* g++.dg/ubsan/pr85029.C: New test.

From-SVN: r258794
parent 631270a5
2018-03-23 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/85029
* sanopt.c (maybe_optimize_ubsan_ptr_ifn): If DECL_REGISTER (base),
just don't try to optimize it rather than assert it never happens.
2018-03-22 Kelvin Nilsen <kelvin@gcc.gnu.org>
* config/rs6000/rs6000-builtin.def: Remove various BU_ALTIVEC_X
......
......@@ -488,9 +488,9 @@ maybe_optimize_ubsan_ptr_ifn (sanopt_ctx *ctx, gimple *stmt)
&unsignedp, &reversep, &volatilep);
if ((offset == NULL_TREE || TREE_CODE (offset) == INTEGER_CST)
&& DECL_P (base)
&& !DECL_REGISTER (base)
&& pbitpos.is_constant (&bitpos))
{
gcc_assert (!DECL_REGISTER (base));
offset_int expr_offset;
if (offset)
expr_offset = wi::to_offset (offset) + bitpos / BITS_PER_UNIT;
......
2018-03-23 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/85029
* g++.dg/ubsan/pr85029.C: New test.
2018-03-23 Alexandre Oliva <aoliva@redhat.com>
PR c++/71251
......@@ -15,7 +20,7 @@
* g++.old-deja/g++.robertl/eb58.C: Likewise.
* g++.old-deja/g++.robertl/eb63.C: Likewise.
2018-03-22 Steven G. Kargl <kargl@gcc.gnu.org
2018-03-22 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/84922
* gfortran.dg/interface_42.f90: New test.
......
// PR sanitizer/85029
// { dg-do compile }
// { dg-skip-if "" { *-*-* } { "-flto -fno-fat-lto-objects" } }
// { dg-options "-fsanitize=undefined" }
struct B {
virtual B bar ();
int e;
} register a; // { dg-error "register name not specified for 'a'" }
int
foo (...)
{
return foo (a);
}
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