Bug 20648 - [4.0 regression] ICE in cfg_layout_redirect_edge_and_branch_force
Summary: [4.0 regression] ICE in cfg_layout_redirect_edge_and_branch_force
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build, ice-on-valid-code, patch
Depends on:
Blocks: 15242
  Show dependency treegraph
 
Reported: 2005-03-26 18:21 UTC by Andreas Schwab
Modified: 2005-04-07 14:44 UTC (History)
3 users (show)

See Also:
Host:
Target: ia64-suse-linux
Build:
Known to work: 3.4.0
Known to fail: 4.0.0
Last reconfirmed: 2005-03-28 22:24:25


Attachments
Patch to ignore blocks with incoming exception edges (699 bytes, patch)
2005-03-28 22:21 UTC, Steven Bosscher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schwab 2005-03-26 18:21:55 UTC
While building libjava: 
 
$ /bin/sh ./libtool --mode=compile /tmp/cvs/gcc-20050326/Build/./gcc/gcj  
-B/tmp/cvs/gcc-20050326/Build/./gcc/ -B/usr/local/ia64-suse-linux/bin/  
-B/usr/local/ia64-suse-linux/lib/ -isystem /usr/local/ia64-suse-linux/include  
-isystem /usr/local/ia64-suse-linux/sys-include -funwind-tables -fclasspath=  
-fbootclasspath=/tmp/cvs/gcc-20050326/Build/ia64-suse-linux/libjava':'../../../libjava':'../../../libjava/external/w3c_dom':'../../../libjava/external/sax  
--encoding=UTF-8 -Wno-deprecated -g -O2 -fjni -findirect-dispatch -c -o  
gnu-xml.lo `find gnu/xml -name '*.class' -print`  
/tmp/cvs/gcc-20050326/Build/./gcc/gcj -B/tmp/cvs/gcc-20050326/Build/./gcc/  
-B/usr/local/ia64-suse-linux/bin/ -B/usr/local/ia64-suse-linux/lib/  
-isystem /usr/local/ia64-suse-linux/include  
-isystem /usr/local/ia64-suse-linux/sys-include -funwind-tables -fclasspath=  
-fbootclasspath=/tmp/cvs/gcc-20050326/Build/ia64-suse-linux/libjava:../../../libjava:../../../libjava/external/w3c_dom:../../../libjava/external/sax  
--encoding=UTF-8 -Wno-deprecated -g -O2 -fjni -findirect-dispatch -c  
gnu/xml/dom/ls/ReaderInputStream.class gnu/xml/dom/ls/WriterOutputStream.class  
gnu/xml/dom/ls/FilteredSAXEventSink.class gnu/xml/dom/ls/DomLSInput.class  
gnu/xml/dom/ls/DomLSOutput.class gnu/xml/dom/ls/DomLSParser.class  
gnu/xml/dom/ls/SAXEventSink.class gnu/xml/dom/ls/DomLSSerializer.class  
gnu/xml/dom/ls/DomLSException.class gnu/xml/dom/DomXPathNSResolver.class  
gnu/xml/dom/ImplementationList.class gnu/xml/dom/DomNsNode.class  
gnu/xml/dom/DomXPathExpression.class gnu/xml/dom/DomNSResolverContext.class  
gnu/xml/dom/JAXPFactory\$JAXPBuilder.class  
gnu/xml/dom/DTDAttributeTypeInfo.class gnu/xml/dom/DomNotation.class  
gnu/xml/dom/DomDocument.class gnu/xml/dom/DomEvent\$DomMutationEvent.class  
gnu/xml/dom/DomCharacterData.class gnu/xml/dom/DomComment.class  
gnu/xml/dom/DomNode\$DomEventException.class gnu/xml/dom/Consumer.class  
gnu/xml/dom/Consumer\$Backdoor.class gnu/xml/dom/DomImpl.class  
gnu/xml/dom/DomDocumentFragment.class  
gnu/xml/dom/DomNode\$ListenerRecord.class gnu/xml/dom/DomEntity.class  
gnu/xml/dom/DomCDATASection.class gnu/xm  
l/dom/DomProcessingInstruction.class  
gnu/xml/dom/DomDocumentConfiguration.class  
gnu/xml/dom/DomNode\$ShadowList.class gnu/xml/dom/DomNode.class  
gnu/xml/dom/DomDocumentBuilderFactory.class  
gnu/xml/dom/DomEvent\$DomUIEvent.class gnu/xml/dom/ImplementationSource.class  
gnu/xml/dom/JAXPFactory.class gnu/xml/dom/DomNamedNodeMap.class  
gnu/xml/dom/DomEntityReference.class gnu/xml/dom/DomElement.class  
gnu/xml/dom/DomDoctype.class gnu/xml/dom/DomExtern.class  
gnu/xml/dom/DomNode\$LiveNodeList.class gnu/xml/dom/DomDocumentBuilder.class  
gnu/xml/dom/DomText.class gnu/xml/dom/DomDOMException.class  
gnu/xml/dom/DomAttr.class gnu/xml/dom/DomNodeIterator.class  
gnu/xml/dom/DTDElementTypeInfo.class gnu/xml/dom/DomEvent.class  
gnu/xml/dom/DomXPathResult.class gnu/xml/dom/DomIterator.class  
gnu/xml/util/SAXNullTransformerFactory.class gnu/xml/util/XCat\$Catalog.class  
gnu/xml/util/XCat\$Loader.class  
gnu/xml/util/SAXNullTransformerFactory\$ListenerAdapter.class  
gnu/xml/util/XMLWriter.class  
gnu/xml/util/SAXNullTransformerFactory\$DomTerminus.class  
gnu/xml/util/DoParse\$MyErrorHandler.class  
gnu/xml/util/SAXNullTransformerFactory\$DomHandler.class  
gnu/xml/util/SAXNullTransformerFactory\$NullTransformer.class  
gnu/xml/util/XHTMLWriter.class gnu/xml/util/DomParser.class  
gnu/xml/util/XCat\$DoneDelegation.class  
gnu/xml/util/SAXNullTransformerFactory\$LocatorAdapter.class  
gnu/xml/util/Resolver.class gnu/xml/util/XCat.class  
gnu/xml/util/SAXNullTransformerFactory\$NullHandler.class  
gnu/xml/util/DoParse.class gnu/xml/transform/Bindings.class  
gnu/xml/transform/OtherwiseNode.class gnu/xml/transform/DocumentFunction.class  
gnu/xml/transform/ProcessingInstructionNode.class  
gnu/xml/transform/FunctionAvailableFunction.class  
gnu/xml/transform/UnparsedEntityUriFunction.class  
gnu/xml/transform/CopyNode.class gnu/xml/transform/NumberNode.class  
gnu/xml/transform/FormatNumberFunction.class  
gnu/xml/transform/URIResolverEntityResolver.class  
gnu/xml/transform/SortKey.class gnu/xml/transform/NodeNumberNode.class  
gnu/xml/transform/TextNode.class gnu/xml/transform/KeyFunction.class  
gnu/xml/transform/Key.class gnu/xml/transform/ChooseNode.class  
gnu/xml/transform/StreamSerializer.class  
gnu/xml/transform/ElementAvailableFunction.class  
gnu/xml/transform/CallTemplateNode.class  
gnu/xml/transform/ApplyImportsNode.class  
gnu/xml/transform/TransformerImpl.class gnu/xml/transform/WhenNode.class  
gnu/xml/transform/MessageNode.class gnu/xml/transform/SAXSerializer.class  
gnu/xml/transform/ParameterNode.class gnu/xml/transform/WithParam.class  
gnu/xml/transform/CurrentFunction.class gnu/xml/transform/CommentNode.class  
gnu/xml/transform/TemplatesImpl.class  
gnu/xml/transform/AbstractNumberNode.class gnu/xml/transform/IfNode.class  
gnu/xml/transform/ElementNode.class gnu/xml/transform/CopyOfNode.class  
gnu/xml/transform/LiteralNode.class  
gnu/xml/transform/ErrorListenerErrorHandler.class  
gnu/xml/transform/GenerateIdFunction.class  
gnu/xml/transform/AttributeNode.class gnu/xml/transform/XSLURIResolver.class  
gnu/xml/transform/Stylesheet.class  
gnu/xml/transform/SystemPropertyFunction.class  
gnu/xml/transform/ValueOfNode.class gnu/xml/transform/ForEachNode.class  
gnu/xml/transform/DOMSourceLocator.class  
gnu/xml/transform/TransformerOutputProperties.class  
gnu/xml/transform/TemplateNode.class  
gnu/xml/transform/TransformerFactoryImpl.class  
gnu/xml/transform/Template.class gnu/xml/transform/ApplyTemplatesNode.class  
gnu/xml/transform/AttributeSet.class gnu/xml/transform/XSLComparator.class  
gnu/xml/xpath/FunctionCall.class gnu/xml/xpath/SubstringFunction.class  
gnu/xml/xpath/StringLengthFunction.class gnu/xml/xpath/Predicate.class  
gnu/xml/xpath/XPathParser\$YyDefRedClass.class gnu/xml/xpath/UnionExpr.class  
gnu/xml/xpath/SubstringBeforeFunction.class  
gnu/xml/xpath/XPathParser\$YyTableClass.class gnu/xml/xpath/LastFunction.class  
gnu/xml/xpath/AndExpr.class gnu/xml/xpath/OrExpr.class  
gnu/xml/xpath/LangFunction.class gnu/xml/xpath/Function.class  
gnu/xml/xpath/ParenthesizedExpr.class  
gnu/xml/xpath/XPathParser\$YyGindexClass.class gnu/xml/xpath/IdFunction.class  
gnu/xml/xpath/RoundFunction.class gnu/xml/xpath/StartsWithFunction.class  
gnu/xml/xpath/XPathParser\$YyDgotoClass.class gnu/xml/xpath/Expr.class  
gnu/xml/xpath/Test.class gnu/xml/xpath/CeilingFunction.class  
gnu/xml/xpath/NamespaceUriFunction.class gnu/xml/xpath/StringFunction.class  
gnu/xml/xpath/NegativeExpr.class gnu/xml/xpath/SubstringAfterFunction.class  
gnu/xml/xpath/LocalNameFunction.class gnu/xml/xpath/XPathFactoryImpl.class  
gnu/xml/xpath/XPathParser.class gnu/xml/xpath/XPathParser\$yyInput.class  
gnu/xml/xpath/TrueFunction.class gnu/xml/xpath/ConcatFunction.class  
gnu/xml/xpath/SumFunction.class gnu/xml/xpath/XPathTokenizer.class  
gnu/xml/xpath/XPathParser\$YyLhsClass.class gnu/xml/xpath/NumberFunction.class  
gnu/xml/xpath/NameTest.class gnu/xml/xpath/XPathParser\$YyRindexClass.class  
gnu/xml/xpath/PositionFunction.class gnu/xml/xpath/Pattern.class  
gnu/xml/xpath/Selector.class gnu/xml/xpath/FloorFunction.class  
gnu/xml/xpath/NormalizeSpaceFunction.class gnu/xml/xpath/RelationalExpr.class  
gnu/xml/xpath/XPathParser\$YyCheckClass.class  
gnu/xml/xpath/VariableReference.class gnu/xml/xpath/NamespaceTest.class  
gnu/xml/xpath/NodeTypeTest.class gnu/xml/xpath/DocumentOrderComparator.class  
gnu/xml/xpath/ArithmeticExpr.class gnu/xml/xpath/FalseFunction.class  
gnu/xml/xpath/XPathParser\$YyLenClass.class gnu/xml/xpath/CountFunction.class  
gnu/xml/xpath/XPathTokenizer\$XPathToken.class  
gnu/xml/xpath/XPathParser\$yyException.class  
gnu/xml/xpath/XPathParser\$YySindexClass.class gnu/xml/xpath/Path.class  
gnu/xml/xpath/NameFunction.class gnu/xml/xpath/XPathImpl.class  
gnu/xml/xpath/ContainsFunction.class gnu/xml/xpath/TranslateFunction.class  
gnu/xml/xpath/XPathParser\$YyNameClass.class gnu/xml/xpath/Constant.class  
gnu/xml/xpath/NotFunction.class gnu/xml/xpath/Root.class  
gnu/xml/xpath/Steps.class gnu/xml/xpath/EqualityExpr.class  
gnu/xml/xpath/BooleanFunction.class  
gnu/xml/pipeline/ValidationConsumer\$Recognizer.class  
gnu/xml/pipeline/LinkFilter.class gnu/xml/pipeline/TextConsumer.class  
gnu/xml/pipeline/DomConsumer.class  
gnu/xml/pipeline/ValidationConsumer\$ChildrenRecognizer.class  
gnu/xml/pipeline/ValidationConsumer\$ElementInfo.class  
gnu/xml/pipeline/TeeConsumer.class  
gnu/xml/pipeline/ValidationConsumer\$AttributeInfo.class  
gnu/xml/pipeline/EventConsumer.class  
gnu/xml/pipeline/CallFilter\$Requestor.class gnu/xml/pipeline/XsltFilter.class  
gnu/xml/pipeline/ValidationConsumer\$EmptyRecognizer.class  
gnu/xml/pipeline/PipelineFactory.class  
gnu/xml/pipeline/ValidationConsumer\$MixedRecognizer.class  
gnu/xml/pipeline/EventFilter.class gnu/xml/pipeline/NSFilter.class  
gnu/xml/pipeline/PipelineFactory\$Pipeline.class  
gnu/xml/pipeline/CallFilter.class gnu/xml/pipeline/WellFormednessFilter.class  
gnu/xml/pipeline/PipelineFactory\$Stage.class  
gnu/xml/pipeline/ValidationConsumer.class  
gnu/xml/pipeline/XIncludeFilter\$Scrubber.class  
gnu/xml/pipeline/XIncludeFilter.class  
gnu/xml/pipeline/DomConsumer\$Handler.class gnu/xml/aelfred2/SAXDriver.class  
gnu/xml/aelfred2/JAXPFactory\$JaxpParser.class  
gnu/xml/aelfred2/XmlReader.class gnu/xml/aelfred2/Attribute.class  
gnu/xml/aelfred2/ContentHandler2.class gnu/xml/aelfred2/JAXPFactory.class  
gnu/xml/aelfred2/SAXDriver\$Adapter.class gnu/xml/aelfred2/XmlReader\$1.class  
gnu/xml/aelfred2/XmlParser.class -fPIC -o .libs/gnu-xml.o  
gnu/xml/util/DomParser.java: In class 'gnu.xml.util.DomParser':  
gnu/xml/util/DomParser.java: In method 'gnu.xml.util.DomParser.walk()':  
gnu/xml/util/DomParser.java:0: internal compiler error: in  
cfg_layout_redirect_edge_and_branch_force, at cfgrtl.c:2620
Comment 1 Andrew Pinski 2005-03-26 18:25:18 UTC
Roger told me he saw the same thing.

This is a middle-end bug.
Comment 2 Andreas Schwab 2005-03-27 18:14:29 UTC
Triggered by this patch from PR15242: 
 
2005-02-01  Steven Bosscher  <stevenb@suse.de> 
 
	PR optimization/15242 
	* params.def (PARAM_MAX_GOTO_DUPLICATION_INSNS): New param. 
	* basic-block.h (duplicate_computed_gotos): Add prototype. 
	* bb-reorder.c (duplicate_computed_gotos): New function to 
	duplicate sufficiently small blocks ending in a computed jump. 
	* passes.c (rest_of_compilation): Call duplicate_computed_gotos 
	if not optimizing for size. 
	* cfgcleanup.c (try_crossjump_bb): If not optimizing for size, 
	never do tail merging for blocks ending in a computed jump. 
	* doc/invoke.texi: Document the max-goto-duplication-insns param. 
 
Comment 3 Steven Bosscher 2005-03-28 21:57:03 UTC
Test case, thanks to Tom Tromey: 
 
T.java: 
public class T 
{ 
  int field; 
  public void test(int f) { 
    synchronized (this) { 
      if (field != 0) 
        throw new IllegalStateException(); 
      field = f; 
    } 
  } 
} 
 
./gcj -B. -B../ia64-unknown-linux-gnu/libjava/ 
-fclasspath=../ia64-unknown-linux-gnu/libjava/ -C T.java 
./gcj -B. -B../ia64-unknown-linux-gnu/libjava/ 
-fclasspath=../ia64-unknown-linux-gnu/libjava/ -c -g -O2 -findirect-dispatch 
T.class 
 
 
Comment 4 Steven Bosscher 2005-03-28 22:21:57 UTC
Created attachment 8475 [details]
Patch to ignore blocks with incoming exception edges

We should not mess with exception edges, I suppose...
Comment 5 Steven Bosscher 2005-03-29 13:22:39 UTC
http://gcc.gnu.org/ml/gcc-patches/2005-03/msg02578.html
Comment 6 CVS Commits 2005-04-03 11:27:53 UTC
Subject: Bug 20648

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	steven@gcc.gnu.org	2005-04-03 11:27:39

Modified files:
	gcc            : bb-reorder.c ChangeLog 

Log message:
	PR middle-end/20648
	* bb-reorder.c (duplicate_computed_gotos): Do not unfactor
	a computed goto if the edge to the computed goto block has
	incoming abnormal edges.  Clarify how the function works.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/bb-reorder.c.diff?cvsroot=gcc&r1=1.97&r2=1.98
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8099&r2=2.8100

Comment 7 Steven Bosscher 2005-04-03 12:49:01 UTC
Should be fixed on mainline now, can someone confirm this for ia64? 
 
Comment 8 Andreas Schwab 2005-04-03 13:24:31 UTC
Regression test still running, but bootstrap has succeeded. 
Comment 9 Andreas Schwab 2005-04-07 09:03:31 UTC
Needs to be fixed on 4.0 branch as well. 
Comment 10 Steven Bosscher 2005-04-07 09:10:03 UTC
The same patch as the one on mainline should work for 4.0.  
Comment 11 CVS Commits 2005-04-07 14:21:54 UTC
Subject: Bug 20648

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	schwab@gcc.gnu.org	2005-04-07 14:21:22

Modified files:
	gcc            : ChangeLog bb-reorder.c 

Log message:
	2005-04-03  Steven Bosscher  <stevenb@suse.de>
	
	PR middle-end/20648
	* bb-reorder.c (duplicate_computed_gotos): Do not unfactor
	a computed goto if the edge to the computed goto block has
	incoming abnormal edges.  Clarify how the function works.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.146&r2=2.7592.2.147
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/bb-reorder.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.92.2.1&r2=1.92.2.2

Comment 12 Andreas Schwab 2005-04-07 14:44:45 UTC
Really fixed now.