Bug 32975 - [4.3 Regression] ICE segfault (verify_cgraph failure after ipa-cp) with -finline-functions -fipa-cp
Summary: [4.3 Regression] ICE segfault (verify_cgraph failure after ipa-cp) with -finl...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.3.0
: P1 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-checking, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2007-08-03 09:18 UTC by Serge Belyshev
Modified: 2007-09-04 08:53 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Belyshev 2007-08-03 09:18:04 UTC
// Compile with -O1 -finline-functions -fipa-cp
// reduced from ada/adadecode.c

static int f0 (char *s0, char *s1)
{
  return __builtin_strlen (s0) > __builtin_strlen (s1);
}

int f1 (char *s, int j)
{
  if (f0 (s, ""))
    return 1;
  return j;
}

void f2 (char *s)
{
  f1 (s, 0);
}

//
bug.c:16: error: edge T.0->__builtin_strlen has no corresponding call_stmt
bug.c:16: internal compiler error: Segmentation fault
Comment 1 Serge Belyshev 2007-08-03 15:06:13 UTC
Fails since:

r121570 | hubicka | 2007-02-04 16:01:13 +0300 (Sun, 04 Feb 2007) | 7 lines

        * ipa-inline.c (try_inline): Improve debug output; work on already
        inline edges too.
        (cgraph_decide_inlining_incrementally): Indent; improve debug output;
        call try_inline for already inlined edges too when flattening; 
        inline also functions that make callee growth but overall unit size
        reduce.

Comment 2 Andrew Pinski 2007-08-07 15:04:59 UTC
This has to do with folding of __builtin_strlen.
Comment 3 Jakub Jelinek 2007-09-04 06:14:00 UTC
Can't reproduce this, neither on x86_64-linux, nor on ppc-linux, on the former
I tried cc1's I had laying around back through to 2007-08-21 and all of them worked.
Comment 4 Jakub Jelinek 2007-09-04 07:30:52 UTC
This got fixed by the PR30564 fix,
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127638
Do we want to commit this testcase as well?
Comment 5 Serge Belyshev 2007-09-04 08:53:29 UTC
(In reply to comment #4)
> This got fixed by the PR30564 fix,
> http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127638
> Do we want to commit this testcase as well?
> 

I think yes, please do.
Comment 6 Jakub Jelinek 2007-09-23 09:44:40 UTC
Subject: Bug 32975

Author: jakub
Date: Sun Sep 23 09:44:23 2007
New Revision: 128688

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128688
Log:
	PR tree-optimization/32772
	* gcc.c-torture/compile/20070905-1.c: New test.

	PR tree-optimization/32975
	* gcc.dg/pr32975.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/20070905-1.c
    trunk/gcc/testsuite/gcc.dg/pr32975.c
Modified:
    trunk/gcc/testsuite/ChangeLog