Commit 694dc72e by Jan Hubicka Committed by Jan Hubicka

tree.c (find_decls_types_r): Remove all non-VAR_DECLs from blocks.


	* tree.c (find_decls_types_r): Remove all non-VAR_DECLs from
	blocks.
	* g++.dg/lto/pr84805_0.C: Update template.
	* g++.dg/lto/pr84805_1.C: Update template.

From-SVN: r261748
parent 583d09f3
2018-06-19 Jan Hubicka <hubicka@ucw.cz>
* tree.c (find_decls_types_r): Remove all non-VAR_DECLs from
blocks.
2018-06-19 Martin Liska <mliska@suse.cz> 2018-06-19 Martin Liska <mliska@suse.cz>
* config/i386/i386.c (ix86_can_inline_p): Do not use * config/i386/i386.c (ix86_can_inline_p): Do not use
......
2018-06-19 Jan Hubicka <hubicka@ucw.cz>
* g++.dg/lto/pr84805_0.C: Update template.
* g++.dg/lto/pr84805_1.C: Update template.
2018-06-19 Eric Botcazou <ebotcazou@adacore.com> 2018-06-19 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/aggr24.adb: New test. * gnat.dg/aggr24.adb: New test.
......
...@@ -23,7 +23,7 @@ template < typename _Tp, _Lock_policy, bool = is_array< _Tp >::value, ...@@ -23,7 +23,7 @@ template < typename _Tp, _Lock_policy, bool = is_array< _Tp >::value,
bool = is_void::value > bool = is_void::value >
class __shared_ptr_access {}; class __shared_ptr_access {};
template < typename _Tp, _Lock_policy _Lp > template < typename _Tp, _Lock_policy _Lp >
class __shared_ptr : __shared_ptr_access< _Tp, _Lp > { // { dg-lto-warning "7: type 'struct __shared_ptr' violates the C\\+\\+ One Definition Rule" } class __shared_ptr : __shared_ptr_access< _Tp, _Lp > {
using element_type = _Tp; using element_type = _Tp;
element_type *_M_ptr; element_type *_M_ptr;
__shared_count< _Lp > _M_refcount; __shared_count< _Lp > _M_refcount;
...@@ -90,7 +90,7 @@ class ExtNameBuff; ...@@ -90,7 +90,7 @@ class ExtNameBuff;
class ExtSheetBuffer; class ExtSheetBuffer;
class ExcelToSc; class ExcelToSc;
class XclImpColRowSettings; class XclImpColRowSettings;
struct RootData { // { dg-lto-warning "8: type 'struct RootData' violates the C\\+\\+ One Definition Rule" } struct RootData {
BiffTyp eDateiTyp; BiffTyp eDateiTyp;
ExtSheetBuffer *pExtSheetBuff; ExtSheetBuffer *pExtSheetBuff;
SharedFormulaBuffer *pShrfmlaBuff; SharedFormulaBuffer *pShrfmlaBuff;
...@@ -105,7 +105,7 @@ class ScExtDocOptions; ...@@ -105,7 +105,7 @@ class ScExtDocOptions;
class XclFontPropSetHelper; class XclFontPropSetHelper;
class XclChPropSetHelper; class XclChPropSetHelper;
class XclTracer; class XclTracer;
struct XclRootData { // { dg-lto-warning "8: type 'struct XclRootData' violates the C\\+\\+ One Definition Rule" } struct XclRootData {
typedef std::shared_ptr< ScEditEngineDefaulter > ScEEDefaulterRef; typedef std::shared_ptr< ScEditEngineDefaulter > ScEEDefaulterRef;
typedef std::shared_ptr< ScHeaderEditEngine > ScHeaderEERef; typedef std::shared_ptr< ScHeaderEditEngine > ScHeaderEERef;
typedef std::shared_ptr< EditEngine > EditEngineRef; typedef std::shared_ptr< EditEngine > EditEngineRef;
...@@ -141,12 +141,12 @@ struct XclRootData { // { dg-lto-warning "8: type 'struct XclRootData' violates ...@@ -141,12 +141,12 @@ struct XclRootData { // { dg-lto-warning "8: type 'struct XclRootData' violates
RootDataRef mxRD; RootDataRef mxRD;
virtual ~XclRootData(); virtual ~XclRootData();
}; };
class XclRoot { // { dg-lto-warning "7: type 'struct XclRoot' violates the C\\+\\+ One Definition Rule" } class XclRoot {
public: public:
virtual ~XclRoot(); virtual ~XclRoot();
XclRootData &mrData; XclRootData &mrData;
}; };
class XclImpRoot : XclRoot {}; // { dg-lto-warning "7: type 'struct XclImpRoot' violates the C\\+\\+ One Definition Rule" } class XclImpRoot : XclRoot {};
class XclImpColRowSettings : XclImpRoot {}; class XclImpColRowSettings : XclImpRoot {};
void lcl_ExportExcelBiff() { void lcl_ExportExcelBiff() {
XclRootData aExpData(); XclRootData aExpData();
......
class XclRoot { class XclRoot { // { dg-lto-warning "7: type 'struct XclRoot' violates the C\\+\\+ One Definition Rule" }
public: public:
virtual ~XclRoot(); virtual ~XclRoot();
}; };
class XclImpRoot : XclRoot {}; class XclImpRoot : XclRoot {};
struct RootData { struct RootData { // { dg-lto-warning "8: type 'struct RootData' violates the C\\+\\+ One Definition Rule" }
XclImpRoot pIR; XclImpRoot pIR;
}; };
class ExcRoot { class ExcRoot {
......
...@@ -5173,7 +5173,10 @@ free_lang_data_in_type (tree type) ...@@ -5173,7 +5173,10 @@ free_lang_data_in_type (tree type)
/* Drop TYPE_DECLs in TYPE_NAME in favor of the identifier in the /* Drop TYPE_DECLs in TYPE_NAME in favor of the identifier in the
TYPE_DECL if the type doesn't have linkage. */ TYPE_DECL if the type doesn't have linkage. */
if (! type_with_linkage_p (type)) if (! type_with_linkage_p (type))
TYPE_NAME (type) = TYPE_IDENTIFIER (type); {
TYPE_NAME (type) = TYPE_IDENTIFIER (type);
TYPE_STUB_DECL (type) = NULL;
}
} }
...@@ -5556,10 +5559,22 @@ find_decls_types_r (tree *tp, int *ws, void *data) ...@@ -5556,10 +5559,22 @@ find_decls_types_r (tree *tp, int *ws, void *data)
} }
else if (TREE_CODE (t) == BLOCK) else if (TREE_CODE (t) == BLOCK)
{ {
tree tem; for (tree *tem = &BLOCK_VARS (t); *tem; )
for (tem = BLOCK_VARS (t); tem; tem = TREE_CHAIN (tem)) {
fld_worklist_push (tem, fld); if (TREE_CODE (*tem) != VAR_DECL
for (tem = BLOCK_SUBBLOCKS (t); tem; tem = BLOCK_CHAIN (tem)) || !auto_var_in_fn_p (*tem, DECL_CONTEXT (*tem)))
{
gcc_assert (TREE_CODE (*tem) != RESULT_DECL
&& TREE_CODE (*tem) != PARM_DECL);
*tem = TREE_CHAIN (*tem);
}
else
{
fld_worklist_push (*tem, fld);
tem = &TREE_CHAIN (*tem);
}
}
for (tree tem = BLOCK_SUBBLOCKS (t); tem; tem = BLOCK_CHAIN (tem))
fld_worklist_push (tem, fld); fld_worklist_push (tem, fld);
fld_worklist_push (BLOCK_ABSTRACT_ORIGIN (t), fld); fld_worklist_push (BLOCK_ABSTRACT_ORIGIN (t), fld);
} }
......
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