+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>
* omp-low.c: Fix some OpenACC comment typos.
--- /dev/null
+// PR middle-end/68259\r
+\r
+// { dg-do compile }\r
+// { dg-options "-fsanitize=undefined -w" }\r
+\r
+namespace std {\r
+ template < typename _Tp > class allocator { };\r
+ template < typename _Tp, typename _Alloc\r
+= std::allocator < _Tp >\r
+>class vector {\r
+ public:\r
+typedef _Tp value_type;\r
+ void push_back (const value_type & __x) { }\r
+ };\r
+}\r
+class Foo;\r
+class FooBar {\r
+public:\r
+Foo * primitive_context;\r
+ FooBar () { }\r
+ FooBar (const FooBar & pnhp);\r
+};\r
+template < class KEY, class CONTENT > class AVLTreeNode { };\r
+template < class KEY, class CONTENT > class FooTree final\r
+{\r
+ FooBar insertPrimitive ();\r
+public:\r
+AVLTreeNode < KEY, CONTENT > *seek_no_lock (const KEY & key) { }\r
+ void primitive_patterns ( std::vector < FooBar > &patterns);\r
+};\r
+template < class KEY, class CONTENT > void FooTree < KEY,\r
+ CONTENT >::primitive_patterns ( std::vector <FooBar > &patterns)\r
+{\r
+ patterns.push_back (insertPrimitive());\r
+}\r
+template < class KEY, class CONTENT >\r
+FooBar FooTree < KEY, CONTENT >::insertPrimitive ()\r
+{\r
+ FooBar place;\r
+ seek_no_lock (place.primitive_context);\r
+ return place;\r
+}\r
+class ManuverResults { };\r
+class opc_info_t\r
+{\r
+public:\r
+FooTree < Foo *, ManuverResults > *primitivecache;\r
+};\r
+static void\r
+do_optical_prox_corr_tsafe (opc_info_t * opc_info)\r
+{\r
+ std::vector < FooBar > patterns;\r
+ opc_info->primitivecache->primitive_patterns (patterns);\r
+}\r
{
case ARRAY_REF:
case COMPONENT_REF:
- /* ??? Fortran can take COMPONENT_REF of a void type. */
- return !VOID_TYPE_P (TREE_TYPE (TREE_OPERAND (t, 0)))
+ /* ??? Fortran can take COMPONENT_REF of a VOID_TYPE. */
+ /* ??? 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)));
case BIT_FIELD_REF: