middle-end/94479 - fix gimplification of address
authorRichard Biener <rguenther@suse.de>
Tue, 7 Apr 2020 14:29:37 +0000 (16:29 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 7 Apr 2020 17:22:14 +0000 (19:22 +0200)
commit3d947f1f27188e3a61ba7f42399b1c348469fe13
tree8281660a504c053f879eb006297334717cb893bc
parent57391ddaf39f7cb85825c32e83feb1435889da51
middle-end/94479 - fix gimplification of address

When gimplifying an address operand we may expose an indirect
ref via DECL_VALUE_EXPR for example.  This is dealt with in the
code already but it fails to consider that INDIRECT_REFs get
gimplified to MEM_REFs.

Fixed which makes the ICE observed on x86_64-netbsd go away.

2020-04-07  Richard Biener  <rguenther@suse.de>

PR middle-end/94479
* gimplify.c (gimplify_addr_expr): Also consider generated
MEM_REFs.

* gcc.dg/torture/pr94479.c: New testcase.
gcc/ChangeLog
gcc/gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr94479.c [new file with mode: 0644]