http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57809
Bug ID: 57809 Summary: Waste work in omega_eliminate_red() Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: pchang9 at cs dot wisc.edu CC: nistor1 at illinois dot edu The problem appears in revision 200588 in version 4.9. In method "omega_eliminate_red()" in gcc/omega.c, the loop on line 2592 should break immediately after "red_found" is set to "1". All the iterations after "red_found" set to "1" do not perform any useful work, at best they just set "red_found" again to "1". There are three more similar problems in the same file gcc/omega.c: 1. omega_problem_has_red_equations(): the loop on line 4854 should break immediately after "result" is set to "true". 2. omega_problem_has_red_equations(): the loop on line 4907 should break immediately after "result" is set to "true". 3. omega_query_variable(): the loop on line 5252 should break immediately after "coupled" is set to "true".