From: Jan Hubicka Date: Fri, 6 Mar 2015 16:12:43 +0000 (+0100) Subject: re PR lto/65302 (LTO: ICE internal compiler error: verify_flow_info failed) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=81b0d9065c3c832af6621e79e9d9b3c2bc684122;p=gcc.git re PR lto/65302 (LTO: ICE internal compiler error: verify_flow_info failed) PR ipa/65302 * value-prof.c (gimple_ic): Pure dead eh edges when needed. * g++.dg/lto/pr65302_1.C: New testcase. * g++.dg/lto/pr65302_0.C: New testcase. From-SVN: r221244 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6573a00c5ca..e25298c55c8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-03-05 Jan Hubicka + + PR ipa/65302 + * value-prof.c (gimple_ic): Pure dead eh edges when needed. + 2015-03-06 Richard Biener PR middle-end/64928 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b042733e9d1..c7de0b16813 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-05 Jan Hubicka + + * g++.dg/lto/pr65302_1.C: New testcase. + * g++.dg/lto/pr65302_0.C: New testcase. + 2015-03-06 James Greenhalgh * gcc.target/arm/atomic-comp-swap-release-acquire.c: Add diff --git a/gcc/testsuite/g++.dg/lto/pr65302_0.C b/gcc/testsuite/g++.dg/lto/pr65302_0.C new file mode 100644 index 00000000000..2298afd9d96 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr65302_0.C @@ -0,0 +1,99 @@ +// { dg-lto-do link } +// { dg-lto-options { { -flto -O2 } } } +// { dg-extra-ld-options "-r -nostdlib -O0" } + +class CstringStorageReference { + public: + ~CstringStorageReference (); +}; +class Cstring { + CstringStorageReference m_stringRef; + public: + Cstring (const char *str, int l = 0); + unsigned int getLength () const; +}; +class ZEvent_Component { }; +class ZEvent_Data { }; +class ZEvent_Interrupt { }; +class ZEvent_Mouse { }; +class ZEvent_Key { }; +class ZEventHandler { + virtual void HandleEvent (const ZEvent_Component & event); + virtual void HandleEvent (const ZEvent_Mouse & event); + virtual void HandleEvent (const ZEvent_Key & event); + virtual void HandleEvent (const ZEvent_Interrupt & event); + virtual void HandleEvent (const ZEvent_Data & event); +}; +enum ZHorizontalAlignment { HA_Left }; +enum ZVerticalAlignment { VA_Baseline }; +struct ZDevicePointStruct { }; +struct ZDeviceRectangleStruct { }; +struct ZDeviceCircleStruct { }; +class ZOutputDevice; +class Foo; +class ZRubberBand { + public: + ZOutputDevice * getOutputDevice (); +}; +class ZRubberBand2P : public ZRubberBand { + virtual void Init (); + Foo *mp_graphicContext; + int m_textAscent; + int m_OkButtonWidth; + int m_OkButtonHeight; +}; +class ZColor { }; +class ZViewPort2D { }; +class ZCursor; +class ZPixmap; +class ZOutputDevice:public ZEventHandler { +public: + typedef ZHorizontalAlignment THorizontalAlignment; + typedef ZVerticalAlignment TVerticalAlignment; + virtual const char *MyName () const { return ""; } + virtual ~ ZOutputDevice (); + virtual Cstring getTitle () const; + virtual void setTitle (const Cstring &) { } + virtual void Init (); + virtual void shutdown (); + virtual void minimize (); + virtual void normalize (); + virtual void raiseToTop (); + virtual ZViewPort2D GetViewPort () const; + virtual void setBackgroundColor (const ZColor & color) = 0; + virtual void Clear () = 0; + virtual void Flush (int forced) = 0; + virtual void dismissCache () { } + virtual int GetDeviceWidth () const = 0; + virtual int GetDeviceHeight () const = 0; + virtual Foo *CreateGraphicContext () = 0; + virtual ZCursor *createCursor (const ZPixmap &, int, int) { return __null; } + virtual void DrawLine (const Foo & gc, int x1, int y1, int x2, int y2) = 0; + virtual void DrawLines (const Foo & gc, const ZDevicePointStruct * points, unsigned int count) = 0; + virtual void FillPolygon (const Foo & gc, const ZDevicePointStruct * points, unsigned int count) = 0; + virtual void DrawPoint (const Foo & gc, int x1, int y1) = 0; + virtual void DrawPoints (const Foo & gc, const ZDevicePointStruct * points, unsigned int count) = 0; + virtual void DrawRectangle (const Foo & gc, int x, int y, int width, int height) = 0; + virtual void DrawRectangles (const Foo & gc, const ZDeviceRectangleStruct * rectangles, unsigned int count) = 0; + virtual void FillRectangle (const Foo & gc, int x, int y, int width, int height) = 0; + virtual void FillRectangles (const Foo & gc, const ZDeviceRectangleStruct * rectangles, unsigned int count) = 0; + virtual void DrawCircle (const Foo & gc, int x, int y, int radius) = 0; + virtual void DrawCircles (const Foo & gc, const ZDeviceCircleStruct * circle, unsigned int count) = 0; + virtual void FillCircle (const Foo & gc, int x, int y, int radius) = 0; + virtual void FillCircles (const Foo & gc, const ZDeviceCircleStruct * circle, unsigned int count) = 0; + virtual void DrawString (const Foo & gc, int xx, int yy, const Cstring & theString, THorizontalAlignment horAlign = HA_Left, TVerticalAlignment verAlign = VA_Baseline) = 0; + virtual void getStringBounds (const Foo & gc, const Cstring & theString, int & width, int & height, int & ascent) const; +}; +template < class T > class EMaskContentVector +{ + signed m_freelist_idx:32; + EMaskContentVector (const EMaskContentVector < T > &, void *buf); +}; +template < class T > EMaskContentVector < + T >::EMaskContentVector (const EMaskContentVector < T > &elem, void *buf): +m_freelist_idx (-1) +{ +} +void ZRubberBand2P::Init () { + getOutputDevice ()->getStringBounds (*mp_graphicContext, Cstring ("Ok"), m_OkButtonWidth, m_OkButtonHeight, m_textAscent); +} diff --git a/gcc/testsuite/g++.dg/lto/pr65302_1.C b/gcc/testsuite/g++.dg/lto/pr65302_1.C new file mode 100644 index 00000000000..b2ccc2a90bc --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr65302_1.C @@ -0,0 +1,83 @@ +#pragma implementation +#pragma interface +class CstringStorageReference { + public: + ~CstringStorageReference (); +}; +class Cstring { + CstringStorageReference m_stringRef; + public: + Cstring (const char *str, int l = 0); + unsigned int getLength () const; +}; +inline unsigned int +Cstring::getLength () const { }; +class ZEvent_Component { }; +class ZEvent_Data { }; +class ZEvent_Interrupt { }; +class ZEvent_Mouse { }; +class ZEvent_Key { }; +class ZEventHandler +{ + virtual void HandleEvent (const ZEvent_Component & event); + virtual void HandleEvent (const ZEvent_Mouse & event); + virtual void HandleEvent (const ZEvent_Key & event); + virtual void HandleEvent (const ZEvent_Interrupt & event); + virtual void HandleEvent (const ZEvent_Data & event); +}; +class ZColor { }; +class ZViewPort2D { }; +enum ZVerticalAlignment { VA_Baseline }; +struct ZDevicePointStruct { }; +class ZCursor; +class ZPixmap; +class Foo; +class ZOutputDevice : public ZEventHandler { + public: + typedef ZVerticalAlignment TVerticalAlignment; + virtual const char *MyName () const { } + virtual ~ ZOutputDevice (); + virtual Cstring getTitle () const; + virtual void setTitle (const Cstring &) { } + virtual void Init (); + virtual void shutdown (); + virtual void minimize (); + virtual void normalize (); + virtual void raiseToTop (); + virtual ZViewPort2D GetViewPort () const; + virtual void setBackgroundColor (const ZColor & color) = 0; + virtual void Clear () = 0; + virtual void Flush (int forced) = 0; + virtual void dismissCache () { } + virtual int GetDeviceWidth () const = 0; + virtual int GetDeviceHeight () const = 0; + virtual Foo *CreateGraphicContext () = 0; + virtual ZCursor *createCursor (const ZPixmap &, int, int) { } + virtual void DrawLine (const Foo & gc, int x1, int y2) = 0; + virtual void DrawLines (const Foo & gc, const ZDevicePointStruct * points, + unsigned int count) = 0; +}; +class ZOutputDevicePS :public ZOutputDevice +{ + virtual void FillPolygon (const Foo & gc, unsigned int count); + virtual void DrawPoint (const Foo & gc, int x1, int y1); + virtual void DrawPoints (const Foo & gc, const ZDevicePointStruct * points, + unsigned int count); + virtual void DrawRectangle (const Foo & gc, int x, int height); + virtual void DrawRectangles (const Foo & gc, unsigned int count); + virtual void FillRectangle (const Foo & gc, int x, int height); + virtual void FillRectangles (const Foo & gc, unsigned int count); + virtual void DrawCircle (const Foo & gc, int x, int y, int radius); + virtual void DrawCircles (const Foo & gc, unsigned int count); + virtual void FillCircle (const Foo & gc, int x, int y, int radius); + virtual void FillCircles (const Foo & gc, unsigned int count); + virtual void DrawString (const Foo & gc, int xx, int yy, + TVerticalAlignment verAlign); + virtual void getStringBounds (const Foo & gc, const Cstring & theString, + int & width, int & height, int & acsent) const; +}; +void +ZOutputDevicePS::getStringBounds (const Foo &, const Cstring & theString, + int & width, int & height, int & ascent) const { + width = theString.getLength () * 8; +} diff --git a/gcc/value-prof.c b/gcc/value-prof.c index 1de8e1b806b..b16bce8746a 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -1576,6 +1576,8 @@ gimple_ic (gcall *icall_stmt, struct cgraph_node *direct_call, PHI_ARG_DEF_FROM_EDGE (phi, e_eh)); } } + if (!stmt_could_throw_p (dcall_stmt)) + gimple_purge_dead_eh_edges (dcall_bb); return dcall_stmt; }