public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/35542]  New: fwprop only propagates one operand
@ 2008-03-11 20:32 hutchinsonandy at aim dot com
  2008-03-11 20:35 ` [Bug rtl-optimization/35542] " hutchinsonandy at aim dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: hutchinsonandy at aim dot com @ 2008-03-11 20:32 UTC (permalink / raw)
  To: gcc-bugs

fwprop.c  currently has a bug where a successful  propagation to one operand 
of an instruction will prevent propagation to any remaining operands.


The cause is due to the use of loc_mentioned_in_p() to check that a reference,
provided by earlier DF scan, still exist in an instruction.

The test is intended to check that an earlier propagation and simplification 
has not removed D/U references.

However, loc_mentioned_in_p(), compares addresses of rtx to determine 
equivalence. If an instruction has already been modified and simplified, this
will
longer apply - even if the def/use is still valid.

This problem was already noted in Nov, but no bug report seems to have been 
filed.

http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00170.html


I will attach patch, that uses reg_mentioned_p() as a substitute. The only
differences I noted where:

a) reg_mentioned_p() does not match physical sub registers of longer hard
registers.
This seems to have no consequence since fwprop entirely rejects hard_registers 
 in latter code. Perhaps for clarity, hard registers could be ignored earlier.

b) registers in asm_operands are found. Which seems beneficial if they are
pseudos and again ignored if they are hard registers.


I am only able to test this with AVR port. In that it was 100% successful with
no 
regressions of torture/execute testsuite.


-- 
           Summary: fwprop only propagates one operand
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hutchinsonandy at aim dot com


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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-08-01  9:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-11 20:32 [Bug rtl-optimization/35542] New: fwprop only propagates one operand hutchinsonandy at aim dot com
2008-03-11 20:35 ` [Bug rtl-optimization/35542] " hutchinsonandy at aim dot com
2008-04-02  9:57 ` bonzini at gcc dot gnu dot org
2008-04-02  9:57 ` [Bug rtl-optimization/35542] [4.3 Regression] " bonzini at gnu dot org
2008-04-02 15:22 ` eric dot weddington at atmel dot com
2008-04-02 15:26 ` bonzini at gnu dot org
2008-04-02 15:45 ` hutchinsonandy at aim dot com
2008-04-29  8:20 ` aoliva at gcc dot gnu dot org
2008-06-11 11:10 ` jsm28 at gcc dot gnu dot org
2008-06-12 10:16 ` jakub at gcc dot gnu dot org
2008-08-01  9:55 ` bonzini at gnu dot org
2008-08-01  9:56 ` bonzini at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).