Bug 44656 - VN should value-replace operands during alias-oracle walk
Summary: VN should value-replace operands during alias-oracle walk
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.6.0
: P3 enhancement
Target Milestone: 4.6.0
Assignee: Richard Biener
URL:
Keywords: alias, missed-optimization
Depends on:
Blocks:
 
Reported: 2010-06-24 15:57 UTC by Richard Biener
Modified: 2010-07-04 10:53 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-07-02 14:58:05


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2010-06-24 15:57:13 UTC
For gcc.dg/tree-ssa/loadpre6.c we see at FRE time

  # PT = { HEAP.9 } (glob)
  # USE = anything
  # CLB = anything
  unexpanded_var_list.0_25 = malloc (16);
  unexpanded_var_list = unexpanded_var_list.0_25;
  # PT = nonlocal escaped { HEAP.9 HEAP.10 } (glob)
  unexpanded_var_list.1_27 = unexpanded_var_list;
  unexpanded_var_list.1_27->list.value = 0B;
  # PT = nonlocal escaped { HEAP.9 HEAP.10 } (glob)
  unexpanded_var_list.1_32 = unexpanded_var_list;
  unexpanded_var_list.1_32->common.chain = 0B;
  # PT = nonlocal escaped { HEAP.9 HEAP.10 } (glob)
  last_34 = unexpanded_var_list;

where when looking up the load in the stmt setting last_34 it is
not disambiguated against unexpanded_var_list.1_32->common.chain
as unexpanded_var_list.1_32 is not value-replaced by
unexpanded_var_list.0_25 and thus stays with the weaker points-to
information.
Comment 1 Richard Biener 2010-07-02 14:58:05 UTC
I have a patch.
Comment 2 Richard Biener 2010-07-04 10:53:00 UTC
Fixed for 4.6.
Comment 3 Richard Biener 2010-07-04 10:53:07 UTC
Subject: Bug 44656

Author: rguenth
Date: Sun Jul  4 10:52:43 2010
New Revision: 161798

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161798
Log:
2010-07-04  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/44656
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Try disambiguation
	again after value-replacing in the defintions lhs.

	* gcc.dg/tree-ssa/loadpre6.c: Remove XFAIL.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
    trunk/gcc/tree-ssa-sccvn.c