This is the mail archive of the gcc-patches@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]

PR35542 Fix fwprop only propagates one operand


This patch fixes problem where incorrect comparison of RTL causes fwprop to omit propagating registers if one propagation has already modified the instruction.
I believe this is a regression as it seemed to have originated from DF changes.


Further details are shown in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35542

The attached copy is the same change listed in the PR updated against todays HEAD.

The fix uses reg_mentioned_p which does not rely on exact equality of LOC - as this will get changed by an earlier propagation.

This patch has been regression tested courtesy of Mike Stein:

the patch "http://gcc.gnu.org/bugzilla/attachment.cgi?id=15300"; caused
0 regressions when applied against trunk, svn revision 133362 for the
target x86_64.

configure flags used for this regression test:
--enable-languages=all \
--disable-nls \
--enable-checking=yes,rtl,df,fold


A short test with linux-2.6.24 (make allmodconfig;make) showed no new ICEs.


I have also tested this on AVR target under Cygwin with no regressions.


Please consider this for approval. My paperwork in on file with FSF.



Andy Hutchinson <hutchinsonamdy@aim.com>


* fwprop.c (forward_propagate_and_simplify): Replace
loc_reg_mentioned_in_p with reg_mentioned_p so that modified RTL can be matched.





Index: fwprop.c
===================================================================
--- fwprop.c    (revision 133399)
+++ fwprop.c    (working copy)
@@ -932,7 +932,7 @@
   else
     parent = PATTERN (use_insn);
 
-  if (!loc_mentioned_in_p (DF_REF_LOC (use), parent))
+  if (!reg_mentioned_p (DF_REF_REG (use), parent))
     return;
 
   def_insn = DF_REF_INSN (def);

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