http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59320

            Bug ID: 59320
           Summary: ftree-vrp breaks simple loops
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
          Assignee: unassigned at gcc dot gnu.org
          Reporter: astra at ionic dot at

Created attachment 31312
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31312&action=edit
File which triggers the bug by using a specific line drawing style.

With -O1 there is no problem.

With "-O1 -ftree-vrp" and with "-O2" it fails to compile the following loop
properly. instead of running the loop 4 times it runs until it segfaults
("il<nd" always returns 1, resulting in "0<4 => 1" as well as "30542<4 => 1"
when showing "il<nd" in a printf.

With "-O2 -fno-tree-vrp" it runs properly.

--
int il, nd;
nd = 4;
for (il =0; il<nd; il ++) {
    if (fl[il] != 0.) {
        ....
    }
}
--
(Source: xfig 3.2.5c, w_drawprim.c:1401)
gcc version 4.8.2 20131017 (Red Hat 4.8.2-1) (GCC)

fedora 14 does not has that issue, but i do not know the specific gcc-version
which was used then.

Reply via email to