http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57780
Bug ID: 57780
Summary: Waste work in subst_dup()
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
Created attachment 30421
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30421&action=edit
Suggested patch
The problem appears in the revision 200588 in version 4.9.
I attached a simple patch that fixes it.
In method "subst_dup" in gensupport.c, the loop on line 2181
should not be executed when "code" equals to "MATCH_DUP" or "MATCH_OP_DUP".
When "code != MATCH_DUP && code != MATCH_OP_DUP" is FALSE,
all the iterations do not perform any useful work.