public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/31651]  New: [4.3 Regression] FRE does not fold intermediate CCP results, FRE does no longer look through loads
@ 2007-04-21 17:51 rguenth at gcc dot gnu dot org
  2007-04-21 17:52 ` [Bug tree-optimization/31651] " rguenth at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-04-21 17:51 UTC (permalink / raw)
  To: gcc-bugs

Split out from PR31136.  Testcase:

struct S {
  unsigned b4:4;
  unsigned b6:6;
} s;

int main(void){
  s.b6 = 31;
  s.b4 = s.b6;
  s.b6 = s.b4;
  return s.b6 == 15 ? 0 : 1;
}

with gcc 4.2 FRE can look through s.b6 to see the 31 for the store to s.b4.
With mainline this no longer happens:

On 4.2 we have for the def_stmt

#   SFT.0D.1539_2 = V_MUST_DEF <SFT.0D.1539_1>;
sD.1526.b6D.1525 = 31

while on the trunk

# SFT.0_10 = VDEF <SFT.0_9(D)> { SFT.0 }
s.b6 = 31

and the predicate !ZERO_SSA_OPERANDS (def_stmt, SSA_OP_VIRTUAL_USES) evaluates
differently on them.  *sigh*


Also, create_value_expr_from does not fold the result even if it produces
constant arguments (generated by above look-through-loads).  This may
confuse fold (as it did in PR31136).


-- 
           Summary: [4.3 Regression] FRE does not fold intermediate CCP
                    results, FRE does no longer look through loads
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


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

end of thread, other threads:[~2007-06-30 14:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-21 17:51 [Bug tree-optimization/31651] New: [4.3 Regression] FRE does not fold intermediate CCP results, FRE does no longer look through loads rguenth at gcc dot gnu dot org
2007-04-21 17:52 ` [Bug tree-optimization/31651] " rguenth at gcc dot gnu dot org
2007-04-21 17:54 ` pinskia at gcc dot gnu dot org
2007-04-21 17:55 ` pinskia at gcc dot gnu dot org
2007-04-21 21:23 ` amacleod at redhat dot com
2007-04-27 23:48 ` pinskia at gcc dot gnu dot org
2007-06-29 18:11 ` mmitchel at gcc dot gnu dot org
2007-06-30 14:16 ` dberlin at gcc dot gnu dot org
2007-06-30 14:17 ` dberlin 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).