Commit f1bc6cae by Jakub Jelinek Committed by Jakub Jelinek

re PR sanitizer/86406 ([UBSAN] -fcompare-debug failure with -fsanitize=undefined)

	PR sanitizer/86406
	* cp-gimplify.c (cp_maybe_instrument_return): Skip trailing
	DEBUG_BEGIN_STMTs.

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

From-SVN: r262536
parent 100291de
2018-07-10 Jakub Jelinek <jakub@redhat.com> 2018-07-10 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/86406
* cp-gimplify.c (cp_maybe_instrument_return): Skip trailing
DEBUG_BEGIN_STMTs.
PR c++/86443 PR c++/86443
* semantics.c (handle_omp_for_class_iterator): Remove lastp argument, * semantics.c (handle_omp_for_class_iterator): Remove lastp argument,
instead of setting *lastp turn orig_declv elt into a TREE_LIST. instead of setting *lastp turn orig_declv elt into a TREE_LIST.
......
...@@ -1621,6 +1621,13 @@ cp_maybe_instrument_return (tree fndecl) ...@@ -1621,6 +1621,13 @@ cp_maybe_instrument_return (tree fndecl)
case STATEMENT_LIST: case STATEMENT_LIST:
{ {
tree_stmt_iterator i = tsi_last (t); tree_stmt_iterator i = tsi_last (t);
while (!tsi_end_p (i))
{
tree p = tsi_stmt (i);
if (TREE_CODE (p) != DEBUG_BEGIN_STMT)
break;
tsi_prev (&i);
}
if (!tsi_end_p (i)) if (!tsi_end_p (i))
{ {
t = tsi_stmt (i); t = tsi_stmt (i);
......
2018-07-10 Jakub Jelinek <jakub@redhat.com> 2018-07-10 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/86406
* g++.dg/ubsan/pr86406.C: New test.
PR fortran/86421 PR fortran/86421
* gfortran.dg/vect/pr86421.f90: New test. * gfortran.dg/vect/pr86421.f90: New test.
......
// PR sanitizer/86406
// { dg-do compile }
// { dg-options "-fcompare-debug -fsanitize=undefined -g -O1" }
typedef enum { } cmd_status;
class ECell;
class ECell_const_ptr { };
class ECell_ptr
{
ECell *mp_element;
ECell *getPointer () const { return mp_element; }
public:
operator ECell_const_ptr () const { return ECell_const_ptr(); }
};
extern ECell_ptr NULL_CELL;
class VwUI_2DCellLayerView;
class view_cell_layoutImpl
{
cmd_status handleChangeFlags (VwUI_2DCellLayerView *
p_ui_celllayerview,
ECell_const_ptr p_peekCell);
cmd_status openCellLayoutView ();
};
cmd_status
view_cell_layoutImpl::openCellLayoutView ()
{
ECell_const_ptr pcell = NULL_CELL;
VwUI_2DCellLayerView *p_user_interface;
return handleChangeFlags (p_user_interface, pcell);
;
}
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