Summary: optimizer loops infinitely
           Product: D
           Version: D2
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2012-08-08 19:04:00 PDT ---

cat > bug.d << CODE
class Foo
    int[] elements;

    final int bar()
        return elements[0];

dmd -c -O bug.d


The bug is caused by infinitely performing two associative transformations.

- cgelem.c(4444): Replace (a op1 (b op2 c)) with ((a op2 b) op1 c)
- cgelem.c(4471): Replace ((a op c1) op c2) with (a op (c2 op c1))

It only happens on OpenBSD because folding 'c2 op c1' fails in evalu8 due to a
fenv.h workaround.
The proposed fix is to perform the first transformation only if 'b' is not a

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to