Commit a91c72e2 by Eric Botcazou Committed by Eric Botcazou

re PR middle-end/68259 ([sso] tree checking failure in…

re PR middle-end/68259 ([sso] tree checking failure in reverse_storage_order_for_component_p, at tree.h:4392)

	PR middle-end/68259
	* tree.h (reverse_storage_order_for_component_p) <COMPONENT_REF>:
	Check that the type of the first operand is an aggregate type.

From-SVN: r230056
parent 374d0225
2015-11-09 Eric Botcazou <ebotcazou@adacore.com>
PR middle-end/68259
* tree.h (reverse_storage_order_for_component_p) <COMPONENT_REF>:
Check that the type of the first operand is an aggregate type.
2015-11-09 Nathan Sidwell <nathan@codesourcery.com> 2015-11-09 Nathan Sidwell <nathan@codesourcery.com>
* omp-low.c: Fix some OpenACC comment typos. * omp-low.c: Fix some OpenACC comment typos.
2015-11-09 Eric Botcazou <ebotcazou@adacore.com>
* g++.dg/ubsan/pr68259.C: New test.
2015-11-09 Uros Bizjak <ubizjak@gmail.com> 2015-11-09 Uros Bizjak <ubizjak@gmail.com>
* g++.dg/cilk-plus/CK/pr66326.cc: Do not include cilk.h. * g++.dg/cilk-plus/CK/pr66326.cc: Do not include cilk.h.
......
// PR middle-end/68259
// { dg-do compile }
// { dg-options "-fsanitize=undefined -w" }
namespace std {
template < typename _Tp > class allocator { };
template < typename _Tp, typename _Alloc
= std::allocator < _Tp >
>class vector {
public:
typedef _Tp value_type;
void push_back (const value_type & __x) { }
};
}
class Foo;
class FooBar {
public:
Foo * primitive_context;
FooBar () { }
FooBar (const FooBar & pnhp);
};
template < class KEY, class CONTENT > class AVLTreeNode { };
template < class KEY, class CONTENT > class FooTree final
{
FooBar insertPrimitive ();
public:
AVLTreeNode < KEY, CONTENT > *seek_no_lock (const KEY & key) { }
void primitive_patterns ( std::vector < FooBar > &patterns);
};
template < class KEY, class CONTENT > void FooTree < KEY,
CONTENT >::primitive_patterns ( std::vector <FooBar > &patterns)
{
patterns.push_back (insertPrimitive());
}
template < class KEY, class CONTENT >
FooBar FooTree < KEY, CONTENT >::insertPrimitive ()
{
FooBar place;
seek_no_lock (place.primitive_context);
return place;
}
class ManuverResults { };
class opc_info_t
{
public:
FooTree < Foo *, ManuverResults > *primitivecache;
};
static void
do_optical_prox_corr_tsafe (opc_info_t * opc_info)
{
std::vector < FooBar > patterns;
opc_info->primitivecache->primitive_patterns (patterns);
}
...@@ -4387,8 +4387,9 @@ reverse_storage_order_for_component_p (tree t) ...@@ -4387,8 +4387,9 @@ reverse_storage_order_for_component_p (tree t)
{ {
case ARRAY_REF: case ARRAY_REF:
case COMPONENT_REF: case COMPONENT_REF:
/* ??? Fortran can take COMPONENT_REF of a void type. */ /* ??? Fortran can take COMPONENT_REF of a VOID_TYPE. */
return !VOID_TYPE_P (TREE_TYPE (TREE_OPERAND (t, 0))) /* ??? UBSan can take COMPONENT_REF of a REFERENCE_TYPE. */
return AGGREGATE_TYPE_P (TREE_TYPE (TREE_OPERAND (t, 0)))
&& TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (TREE_OPERAND (t, 0))); && TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (TREE_OPERAND (t, 0)));
case BIT_FIELD_REF: case BIT_FIELD_REF:
......
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