Bug 92751 - VN partial def support confused about clobbers
Summary: VN partial def support confused about clobbers
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: ---
Assignee: Richard Biener
URL:
Keywords: missed-optimization
Depends on:
Blocks: 92645
  Show dependency treegraph
 
Reported: 2019-12-02 15:17 UTC by Richard Biener
Modified: 2019-12-03 10:48 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2019-12-02 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2019-12-02 15:17:45 UTC
FRE doesn't optimize

  MEM[(struct Vec *)&D.195309] ={v} {CLOBBER};
  MEM[(struct Vec *)&D.195309].val = 128;
  MEM[(struct Vec *)&D.195309 + 2B] ={v} {CLOBBER};
  MEM[(struct Vec *)&D.195309 + 2B].val = 128;
...
  MEM[(struct Vec *)&D.195309 + 28B].val = 128;
  MEM[(struct Vec *)&D.195309 + 30B] ={v} {CLOBBER};
  MEM[(struct Vec *)&D.195309 + 30B].val = 128;
  _127 = MEM <vector(16) short unsigned int> [(char * {ref-all})&D.195309];

to a vector constant because it's confused by the CLOBBERs.
Comment 1 Richard Biener 2019-12-02 15:18:02 UTC
Mine.
Comment 2 Richard Biener 2019-12-03 10:47:23 UTC
Author: rguenth
Date: Tue Dec  3 10:46:52 2019
New Revision: 278931

URL: https://gcc.gnu.org/viewcvs?rev=278931&root=gcc&view=rev
Log:
2019-12-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92751
	* tree-ssa-sccvn.c (vn_walk_cb_data::push_partial_def): Fail
	when a clobber ends up in the partial-def vector.
	(vn_reference_lookup_3): Let clobbers be handled by the
	assignment from CTOR handling.

	* g++.dg/tree-ssa/pr92751.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/tree-ssa/pr92751.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-sccvn.c
Comment 3 Richard Biener 2019-12-03 10:48:54 UTC
Fixed.