diff options
author | Richard Biener <rguenther@suse.de> | 2015-05-13 10:53:42 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-05-13 10:53:42 +0000 |
commit | 2ae1d1b8b2284ea21a7d4dac20dd574e24ed0138 (patch) | |
tree | 9e27beb313e792b09ca9438f61a123ebc466411f | |
parent | 6ef9367656a2bbe734f134a029f7880b9b62227f (diff) | |
download | gcc-2ae1d1b8b2284ea21a7d4dac20dd574e24ed0138.zip gcc-2ae1d1b8b2284ea21a7d4dac20dd574e24ed0138.tar.gz gcc-2ae1d1b8b2284ea21a7d4dac20dd574e24ed0138.tar.bz2 |
re PR middle-end/66110 (uint8_t memory access not optimized)
2015-05-13 Richard Biener <rguenther@suse.de>
PR middle-end/66110
* alias.c (alias_sets_conflict_p): Do not treat has_zero_child
specially.
* Makefile.in (dfp.o-warn): Add -Wno-strict-aliasing.
* gcc.dg/alias-2.c: Adjust.
* gcc.dg/tree-ssa/ssa-dse-17.c: New testcase.
From-SVN: r223126
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/Makefile.in | 1 | ||||
-rw-r--r-- | gcc/alias.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/alias-2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-17.c | 20 |
6 files changed, 37 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b0b72d0..aa9c72e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-05-13 Richard Biener <rguenther@suse.de> + + PR middle-end/66110 + * alias.c (alias_sets_conflict_p): Do not treat has_zero_child + specially. + * Makefile.in (dfp.o-warn): Add -Wno-strict-aliasing. + 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> * doc/install.texi: Bump latest automake 1.11 version to 1.11.6. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index fe22236..ab9b637 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -211,6 +211,7 @@ libgcov-driver-tool.o-warn = -Wno-error libgcov-merge-tool.o-warn = -Wno-error gimple-match.o-warn = -Wno-unused generic-match.o-warn = -Wno-unused +dfp.o-warn = -Wno-strict-aliasing # All warnings have to be shut off in stage1 if the compiler used then # isn't gcc; configure determines that. WARN_CFLAGS will be either diff --git a/gcc/alias.c b/gcc/alias.c index 7d9a3d9..4bbad31 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -470,15 +470,13 @@ alias_sets_conflict_p (alias_set_type set1, alias_set_type set2) /* See if the first alias set is a subset of the second. */ ase = get_alias_set_entry (set1); if (ase != 0 - && (ase->has_zero_child - || ase->children->get (set2))) + && ase->children->get (set2)) return 1; /* Now do the same, but with the alias sets reversed. */ ase = get_alias_set_entry (set2); if (ase != 0 - && (ase->has_zero_child - || ase->children->get (set1))) + && ase->children->get (set1)) return 1; /* The two alias sets are distinct and neither one is the diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b5f96f3..be35550 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-05-13 Richard Biener <rguenther@suse.de> + + PR middle-end/66110 + * gcc.dg/alias-2.c: Adjust. + * gcc.dg/tree-ssa/ssa-dse-17.c: New testcase. + 2015-05-13 Ilya Enkovich <ilya.enkovich@intel.com> PR target/65103 diff --git a/gcc/testsuite/gcc.dg/alias-2.c b/gcc/testsuite/gcc.dg/alias-2.c index d507416..f42f22c 100644 --- a/gcc/testsuite/gcc.dg/alias-2.c +++ b/gcc/testsuite/gcc.dg/alias-2.c @@ -11,6 +11,6 @@ struct foo { int sub1 (long long int foobar) { - struct foo *tmp = (struct foo *) &foobar; // { dg-warning "type-punned pointer might" "" } + struct foo *tmp = (struct foo *) &foobar; // { dg-warning "type-punned pointer will" "" } return tmp->i; } diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-17.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-17.c new file mode 100644 index 0000000..c565777 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-17.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-dse1" } */ + +struct s1 { + unsigned short f1; + unsigned char f2; +}; + +struct s2 { + struct s1 *p1; +}; + +void f1(struct s2 *p) +{ + p->p1->f2 = 9; + p->p1->f2 = 10; +} + +/* { dg-final { scan-tree-dump-times "f2 =" 1 "dse1" } } */ +/* { dg-final { cleanup-tree-dump "dse1" } } */ |