Bug 12977 - [tree-ssa] ICE while verify_flow_info
Summary: [tree-ssa] ICE while verify_flow_info
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: tree-ssa
: P1 critical
Target Milestone: tree-ssa
Assignee: Not yet assigned to anyone
URL:
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-11-09 08:27 UTC by Andrew Pinski
Modified: 2003-11-09 21:10 UTC (History)
1 user (show)

See Also:
Host:
Target: powerpc-apple-darwin7.0.0
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-11-09 08:54:52


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2003-11-09 08:27:30 UTC
Try compile the following code will produce an ICE, I think this is a problem every where:
typedef int ptrdiff_t;
typedef long unsigned int size_t;
namespace std
{
  using ::ptrdiff_t;
  using ::size_t;
}
void* operator new(std::size_t) throw (int);
extern "C" {
void *malloc(size_t);
}
void *
operator new (std::size_t sz) throw (int)
{
  void *p;
  p = (void *) malloc (sz);
  while (p == 0)
      p = (void *) malloc (sz);
  return p;
}


./cc1plus -O test.cc
 void* operator new(size_t)
Block missordering after bb 2

test.cc: In function `void* operator new(size_t)':
test.cc:14: internal compiler error: verify_flow_info failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Andrew Pinski 2003-11-09 08:54:50 UTC
The problem is that a BB is not being removed by DCE:
SSA information for void* operator new(size_t)

;; basic block 0, loop depth 0, count 0
;; prev block -1, next block 1
;; pred:       ENTRY
;; succ:       1 (fallthru) 6 (ab,eh)
16  T.2_4 = malloc (sz_3)
    


;; basic block 1, loop depth 0, count 0
;; prev block 0, next block 2
;; pred:       0 (fallthru)
;; succ:       4
-1  (void)0
17  goto <U8d24>;
    


;; basic block 2, loop depth 0, count 0
;; prev block 1, next block 3
;; pred:       4 (false)
;; succ:       3 (fallthru) 6 (ab,eh)
-1  <U8e0c>:;
18  T.1_7 = malloc (sz_3)
    


;; basic block 3, loop depth 0, count 0 <--- this one.
;; prev block 2, next block 4
;; pred:       2 (fallthru)
;; succ:       4 (fallthru)
-1  (void)0
    


;; basic block 4, loop depth 0, count 0
;; prev block 3, next block 5
;; pred:       3 (fallthru) 1
;; succ:       2 (false) 5 (true)
# p_1 = PHI <T.2_4(1), T.1_7(3)>;
-1  <U8d24>:;
17  if (p_1 != 0B)
  {
    goto <U8b54>;
  }
else
  {
    goto <U8e0c>;
  }
    p_1 = PHI <T.2_4(1), T.1_7(3)>;


;; basic block 5, loop depth 0, count 0
;; prev block 4, next block 6
;; pred:       4 (true)
;; succ:       EXIT
-1  <U8b54>:;
19  return p_1;
    


;; basic block 6, loop depth 0, count 0
;; prev block 5, next block -2
;; pred:       2 (ab,eh) 0 (ab,eh)
;; succ:      
-1  <U8f68>:;
20  __cxa_call_unexpected (<<<exception object>>>)
    
Comment 2 Andrew Pinski 2003-11-09 21:10:19 UTC
Fixed by:
2003-11-09  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>

        * tree-cfg.c (tree_verify_flow_info): Fix checking of order of
        basic blocks over code.