forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add -funconstrained-commons to work around PR/69368 (and others) in S…
…PEC2006 gcc/: * common.opt (funconstrained-commons, flag_unconstrained_commons): New. * tree.c (array_at_struct_end_p): Do not limit to size of decl for DECL_COMMONS if flag_unconstrained_commons is set. * tree-dfa.c (get_ref_base_and_extent): Likewise. * doc/invoke.texi (Optimize Options): Add -funconstrained-commons. (funconstrained-commons): Document. gcc/testsuite: * gfortran.dg/unconstrained_commons.f: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234106 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
alalaw01
committed
Mar 10, 2016
1 parent
bfe9720
commit 5ab2987
Showing
7 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
! { dg-do compile } | ||
! { dg-options "-O3 -funconstrained-commons -fdump-tree-dom2-details" } | ||
|
||
! Test for PR69368: a single-element array in a common block, which will be | ||
! overridden with a larger size at link time (contrary to language spec). | ||
! Dominator opts considers accesses to differently-computed elements of X as | ||
! equivalent, unless -funconstrained-commons is passed in. | ||
SUBROUTINE FOO | ||
IMPLICIT DOUBLE PRECISION (X) | ||
INTEGER J | ||
COMMON /MYCOMMON / X(1) | ||
DO 10 J=1,1024 | ||
X(J+1)=X(J+7) | ||
10 CONTINUE | ||
RETURN | ||
END | ||
! { dg-final { scan-tree-dump-not "FIND" "dom2" } } | ||
! We should retain both a read and write of mycommon.x. | ||
! { dg-final { scan-tree-dump-times " _\[0-9\]+ = mycommon\\.x\\\[_\[0-9\]+\\\];" 1 "dom2" } } | ||
! { dg-final { scan-tree-dump-times " mycommon\\.x\\\[_\[0-9\]+\\\] = _\[0-9\]+;" 1 "dom2" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters