https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79090
Bug ID: 79090
Summary: [7 regression] DSE wrongly removing store at variable
offset
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: ebotcazou at gcc dot gnu.org
CC: law at gcc dot gnu.org
Target Milestone: ---
Created attachment 40520
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40520&action=edit
Reduced testcase
The latest DSE changes introduced a regression in the ACATS testsuite:
=== acats tests ===
FAIL: c432003
=== acats Summary ===
# of expected passes 2319
# of unexpected failures 1
Native configuration is x86_64-suse-linux-gnu
Reduced testcase attached, to be compiled like this:
eric@polaris:~/build/gcc/native> gnatchop testcase.txt
splitting testcase.txt into:
opt62.adb
opt62_pkg.ads
eric@polaris:~/build/gcc/native> gnatmake opt62 -O
gcc -c -O opt62.adb
gcc -c -O opt62_pkg.ads
gnatbind -x opt62.ali
gnatlink opt62.ali -O
eric@polaris:~/build/gcc/native> ./opt62
raised PROGRAM_ERROR : opt62.adb:13 explicit raise
eric@polaris:~/build/gcc/native> gcc/xgcc -Bgcc -S opt62.adb -O
-fdump-tree-dse1-details
This is the wrong store removal:
;; Function Opt62 (_ada_opt62, funcdef_no=1, decl_uid=4169, cgraph_uid=0,
symbol_order=0)
Deleted dead store: MEM[(struct opt62_pkg__unconstrained_der &)&d].str1{off:
_17 * 8} = "abcde";
The testcase can be added directly to the gnat.dg testsuite.