aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorToon Moene <toon@moene.indiv.nluug.nl>2002-03-23 21:00:10 +0100
committerToon Moene <toon@gcc.gnu.org>2002-03-23 20:00:10 +0000
commit7b119cc6341670ce24c840dab6c552e2596abd77 (patch)
tree972ea783deb451c270a98219c6342cd5dd0e3be3 /gcc
parent64e92a2664338473268928c206f62ba397379601 (diff)
downloadgcc-7b119cc6341670ce24c840dab6c552e2596abd77.zip
gcc-7b119cc6341670ce24c840dab6c552e2596abd77.tar.gz
gcc-7b119cc6341670ce24c840dab6c552e2596abd77.tar.bz2
com.c (ffecom_check_size_overflow_): Add a test so that arrays too large for 32-bit byte-offset addressing get caught.
2002-03-23 Toon Moene <toon@moene.indiv.nluug.nl> * com.c (ffecom_check_size_overflow_): Add a test so that arrays too large for 32-bit byte-offset addressing get caught. * news.texi: Document the fixing of this problem. From-SVN: r51243
Diffstat (limited to 'gcc')
-rw-r--r--gcc/f/ChangeLog7
-rw-r--r--gcc/f/com.c7
-rw-r--r--gcc/f/news.texi46
3 files changed, 38 insertions, 22 deletions
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 9f2016c..2f0f678 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,10 @@
+2002-03-23 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * com.c (ffecom_check_size_overflow_): Add a test
+ so that arrays too large for 32-bit byte-offset
+ addressing get caught.
+ * news.texi: Document the fixing of this problem.
+
Sat Mar 23 11:18:17 2002 Andrew Cagney <ac131313@redhat.com>
* invoke.texi (Warning Options): Mention -Wswitch-default.
diff --git a/gcc/f/com.c b/gcc/f/com.c
index fa64b99c..f698ae9 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -2262,8 +2262,13 @@ ffecom_check_size_overflow_ (ffesymbol s, tree type, bool dummy)
if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
return type;
+ /* An array is too large if size is negative or the type_size overflows
+ or its "upper half" is larger than 3 (which would make the signed
+ byte size and offset computations overflow). */
+
if ((tree_int_cst_sgn (TYPE_SIZE (type)) < 0)
- || (!dummy && TREE_OVERFLOW (TYPE_SIZE (type))))
+ || (!dummy && (TREE_INT_CST_HIGH (TYPE_SIZE (type)) > 3
+ || TREE_OVERFLOW (TYPE_SIZE (type)))))
{
ffebad_start (FFEBAD_ARRAY_LARGE);
ffebad_string (ffesymbol_text (s));
diff --git a/gcc/f/news.texi b/gcc/f/news.texi
index 811ae57..a00efe3 100644
--- a/gcc/f/news.texi
+++ b/gcc/f/news.texi
@@ -10,7 +10,7 @@
@c in the standalone derivations of this file (e.g. NEWS).
@set copyrights-news 1995,1996,1997,1998,1999,2000,2001,2002
-@set last-update-news 2002-02-13
+@set last-update-news 2002-03-23
@include root.texi
@@ -157,26 +157,30 @@ The following information was last updated on @value{last-update-news}:
@itemize @bullet
@item
Problem Reports fixed (in chronological order of submission):
-@enumerate
-@item
- 947 Data statement initialization with subscript of kind INTEGER*2
-@item
-3743 Reference to intrinsic `ISHFT' invalid
-@item
-3807 Function BESJN(integer,double) problems
-@item
-3957 g77 -pipe -xf77-cpp-input sends output to stdout
-@item
-4279 g77 -h" gives bogus output
-@item
-4752 g77 -v -c -xf77-version /dev/null -xnone causes ice
-@item
-4885 BACKSPACE example that doesn't work as of gcc/g77-3.0.x
-@item
-5122 g77 rejects accepted use of INTEGER*2 as type of DATA statement loop index
-@item
-5473 ICE on BESJN(integer*8,real)
-@end enumerate
+@table @code
+@item 947
+Data statement initialization with subscript of kind INTEGER*2
+@item 3743
+Reference to intrinsic `ISHFT' invalid
+@item 3807
+Function BESJN(integer,double) problems
+@item 3957
+g77 -pipe -xf77-cpp-input sends output to stdout
+@item 4279
+g77 -h" gives bogus output
+@item 4730
+ICE on valid input using CALL EXIT(%VAL(...))
+@item 4752
+g77 -v -c -xf77-version /dev/null -xnone causes ice
+@item 4885
+BACKSPACE example that doesn't work as of gcc/g77-3.0.x
+@item 5122
+g77 rejects accepted use of INTEGER*2 as type of DATA statement loop index
+@item 5397
+ICE on compiling source with 540 000 000 REAL array
+@item 5473
+ICE on BESJN(integer*8,real)
+@end table
@item
@command{g77} now has its man page generated from the texinfo documentation,