Bug 17951

Summary: Dominance info is incorrect for entry and exit blocks
Product: gcc Reporter: Daniel Berlin <dberlin>
Component: middle-endAssignee: Not yet assigned to anyone <unassigned>
Status: NEW ---    
Severity: normal CC: gcc-bugs, jamborm
Priority: P2 Keywords: internal-improvement, wrong-code
Version: 4.0.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2005-12-24 19:53:44

Description Daniel Berlin 2004-10-12 17:48:06 UTC
The dominance info is incorrect for entry and exit blocks.

According to dominated_by_p, nothing dominates the exit block (which is wrong),
and nothing post-dominates the entry block (which is also wrong).

A simple example:
(gdb) p dominated_by_p (CDI_POST_DOMINATORS, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR)
$4 = 0 '\0'
(gdb) p dominated_by_p (CDI_DOMINATORS, EXIT_BLOCK_PTR, ENTRY_BLOCK_PTR)
$5 = 0 '\0'

Both of these should return true.
Zdenek said he thought he knew why this was.
Comment 1 Andrew Pinski 2004-10-12 17:53:16 UTC
Confirmed.