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



             Bug #: 57151

           Summary: Wasted work in method verify_cgraph_node

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: other

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: pcha...@cs.wisc.edu





Created attachment 30012

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30012

Suggested patch



The problem appears in version 4.8 and in revision 198496. I attached

a one-line patch that fixes it.



In method "verify_cgraph_node" in cgraph.c, the second loop over

"node->indirect_calls" should break immediately after "error_found" is

set to "true".  All the iterations after "error_found" is set to

"true" do not perform any useful work, at best they just set

"error_found" again to "true".



Method "ix86_legitimate_combined_insn" in i386.c has a similar loop

over "recog_data.n_alternatives", and this loop breaks immediately

after "win" is set to "true", just like in the proposed patch.  Other

methods (e.g., "tagged_types_tu_compatible_p" in c-typeck.c,

"rest_of_record_type_compilation" in utils.c, "distance_agu_use" in

i386.c) also have similar loops that break like in the proposed patch.

Reply via email to