The following piece of code triggers a bug in the dominator optimizations. With -fno-tree-dominator-opts the correct result is given back.
volatile int x; int main () { volatile int *vip; vip = &x; const volatile int *cvip; cvip = vip; if (vip != cvip) return -1; return 0; } -- Summary: [4.1 Regression] Wrong code with SSA dominator optimizations Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: critical Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: paul dot woegerer at nsc dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: crx-unknown-elf http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22321