diff options
author | Richard Biener <rguenther@suse.de> | 2016-04-22 06:59:32 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-04-22 06:59:32 +0000 |
commit | d14311920581dff3d36aba3e3aeb53f82213ef83 (patch) | |
tree | 3dbbdf8741398302abc4ad7ab86ec8c77a39c29d | |
parent | b8ce3fe29de6163328de75c3f733752c2391c093 (diff) | |
download | gcc-d14311920581dff3d36aba3e3aeb53f82213ef83.zip gcc-d14311920581dff3d36aba3e3aeb53f82213ef83.tar.gz gcc-d14311920581dff3d36aba3e3aeb53f82213ef83.tar.bz2 |
re PR tree-optimization/70740 (ICE when compiling the Linux kernel (net/wireless/util.o))
2016-04-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/70740
* tree-ssa-phiprop.c (propagate_with_phi): Handle inserted
VDEF.
* gcc.dg/torture/pr70740.c: New testcase.
From-SVN: r235359
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr70740.c | 38 | ||||
-rw-r--r-- | gcc/tree-ssa-phiprop.c | 8 |
4 files changed, 54 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 06ff30c..d0aeef4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-04-22 Richard Biener <rguenther@suse.de> + + PR tree-optimization/70740 + * tree-ssa-phiprop.c (propagate_with_phi): Handle inserted + VDEF. + 2016-04-21 H.J. Lu <hongjiu.lu@intel.com> PR target/70750 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 38b18c9..e5eff26 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-04-22 Richard Biener <rguenther@suse.de> + + PR tree-optimization/70740 + * gcc.dg/torture/pr70740.c: New testcase. + 2016-04-21 H.J. Lu <hongjiu.lu@intel.com> PR target/70750 diff --git a/gcc/testsuite/gcc.dg/torture/pr70740.c b/gcc/testsuite/gcc.dg/torture/pr70740.c new file mode 100644 index 0000000..5bf8e4a --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr70740.c @@ -0,0 +1,38 @@ +/* { dg-do compile } */ + +extern int foo (void); +extern void *memcpy (void *, const void *, __SIZE_TYPE__); + +struct +{ + char a[6]; +} d; +struct +{ + int a1[0]; + int a2[0]; + int a3[0]; + int a4[]; +} a, c; +int b; + +int * +bar () +{ + if (b) + return a.a4; + return a.a2; +} + +void +baz () +{ + int *e, *f; + if (foo ()) + e = c.a3; + else + e = c.a1; + memcpy (d.a, e, 6); + f = bar (); + memcpy (d.a, f, 1); +} diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c index 97e5663..80d2fc4 100644 --- a/gcc/tree-ssa-phiprop.c +++ b/gcc/tree-ssa-phiprop.c @@ -327,13 +327,15 @@ propagate_with_phi (basic_block bb, gphi *phi, struct phiprop_d *phivn, continue; /* Check if we can move the loads. The def stmt of the virtual use - needs to be in a different basic block dominating bb. */ + needs to be in a different basic block dominating bb. When the + def is an edge-inserted one we know it dominates us. */ vuse = gimple_vuse (use_stmt); def_stmt = SSA_NAME_DEF_STMT (vuse); if (!SSA_NAME_IS_DEFAULT_DEF (vuse) && (gimple_bb (def_stmt) == bb - || !dominated_by_p (CDI_DOMINATORS, - bb, gimple_bb (def_stmt)))) + || (gimple_bb (def_stmt) + && !dominated_by_p (CDI_DOMINATORS, + bb, gimple_bb (def_stmt))))) goto next; /* Found a proper dereference with an aggregate copy. Just |