This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/55629] New: Missed value numbering to a constant


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

             Bug #: 55629
           Summary: Missed value numbering to a constant
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: steven@gcc.gnu.org


Consider a classic example of non-distributivity of constant propagation:

int foo (int);
int foo (int c) {
  int a, b;
  if (c) { a = 3; b = 2; }
  else { a = 2; b = 3; }
  return a + b;
}

Value numbering should be able to determine that a+b=5. GCC successfully
optimizes the test case to just "return 5" with -ftree-pre, but with "only"
-ftree-fre (-O1) the equivalence is not noticed.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]