Bug 41835 - ICE with -flto -O3 (BB N can not throw but has an EH edge)
Summary: ICE with -flto -O3 (BB N can not throw but has an EH edge)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, lto
Depends on:
Blocks:
 
Reported: 2009-10-26 19:06 UTC by Andrew Pinski
Modified: 2010-04-23 15:38 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-10-26 20:56:03


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2009-10-26 19:06:06 UTC
Looks like something is not removing the EH edges.
Anyways here is a simple testcase:
file 1):
void Stop_Profile( void );
struct CProfileSample { 
  ~CProfileSample( void )  { 
  Stop_Profile(); 
 }
};
void integrateVelocities(int);
void predictUnconstraintMotion(int size)
{
  CProfileSample __profile;
  for ( int i=0;i<size;i++) 
    integrateVelocities(1);
}

--- CUT ---
File 2:
void integrateVelocities(int) { }
void Stop_Profile( void ) {  }

--- CUT ---
Comment 1 Richard Biener 2009-10-26 20:56:02 UTC
Confirmed.  There is a crude fixup pass, but this should be handled by
IPA nothrow (which doesn't exist).
Comment 2 Jan Hubicka 2009-12-11 11:37:57 UTC
ipa nothrow is hidden in ipa-pure-const (that should be renamed eventually).
However issue here is that at IPA stage we should not touch function bodies, so we should not do these updates.  This is why fixup pass exists to resolve these cases after we get into local compilation.

This however seems like LTO is getting something wrong, we do make throw flags to disappear at IPA for quite some time.
Comment 3 Richard Biener 2010-04-23 15:38:12 UTC
Seems to work for me, even with the 4.5.0 release.
Comment 4 Jan Hubicka 2010-04-25 23:44:30 UTC
Subject: Re:  ICE with -flto -O3 (BB N can not
	throw but has an EH edge)

> Seems to work for me, even with the 4.5.0 release.
Note that on mainline the code removing wpa fixup should help here too.  There clearly was bugs.

Honza