aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2015-03-04 22:33:41 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-03-04 22:33:41 +0000
commitd10a61fbe8a35256164aca7a9a7a51d16cc57370 (patch)
treebb433524b1c9c0c35778ec90ef3d9c1bdf9ab01f /gcc
parent8ed4390c3f34ece8009bc43ae592c9f3ed66dcd7 (diff)
downloadgcc-d10a61fbe8a35256164aca7a9a7a51d16cc57370.zip
gcc-d10a61fbe8a35256164aca7a9a7a51d16cc57370.tar.gz
gcc-d10a61fbe8a35256164aca7a9a7a51d16cc57370.tar.bz2
fold-const.c (round_up_loc): Cast divisor to signed on all paths before negating it.
* fold-const.c (round_up_loc): Cast divisor to signed on all paths before negating it. * stor-layout.c (finalize_record_size): Revert latest change. From-SVN: r221198
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/fold-const.c6
-rw-r--r--gcc/stor-layout.c5
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gnat.dg/entry_queues3.adb29
5 files changed, 44 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 56c844b..72760c0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * fold-const.c (round_up_loc): Cast divisor to signed on all paths
+ before negating it.
+ * stor-layout.c (finalize_record_size): Revert latest change.
+
2015-03-04 Andreas Tobler <andreast@gcc.gnu.org>
* config/rs6000/t-freebsd64: Remove 32-bit soft-float multilibs.
@@ -25,8 +31,8 @@
2015-03-04 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
- * gcc/config/s390/s390.c (s390_expand_builtin): Exlude non-htm
- builtins from checking for -mhtm option.
+ * config/s390/s390.c (s390_expand_builtin): Exlude non-htm builtins
+ from checking for -mhtm option.
2015-03-03 Jan Hubicka <hubicka@ucw.cz>
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index f9f7f26..0834d47 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -16019,8 +16019,8 @@ round_up_loc (location_t loc, tree value, unsigned int divisor)
return value;
overflow_p = TREE_OVERFLOW (value);
- val &= ~(divisor - 1);
- val += divisor;
+ val += divisor - 1;
+ val &= - (int) divisor;
if (val == 0)
overflow_p = true;
@@ -16032,7 +16032,7 @@ round_up_loc (location_t loc, tree value, unsigned int divisor)
t = build_int_cst (TREE_TYPE (value), divisor - 1);
value = size_binop_loc (loc, PLUS_EXPR, value, t);
- t = build_int_cst (TREE_TYPE (value), - (HOST_WIDE_INT) divisor);
+ t = build_int_cst (TREE_TYPE (value), - (int) divisor);
value = size_binop_loc (loc, BIT_AND_EXPR, value, t);
}
}
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 273a12b..f18f1ac 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -1627,11 +1627,6 @@ finalize_record_size (record_layout_info rli)
unpadded_size_unit
= size_binop (PLUS_EXPR, unpadded_size_unit, size_one_node);
- if (TREE_CODE (unpadded_size_unit) == INTEGER_CST
- && !TREE_OVERFLOW (unpadded_size_unit)
- && !valid_constant_size_p (unpadded_size_unit))
- error ("type %qT is too large", rli->t);
-
/* Round the size up to be a multiple of the required alignment. */
TYPE_SIZE (rli->t) = round_up (unpadded_size, TYPE_ALIGN (rli->t));
TYPE_SIZE_UNIT (rli->t)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2e77ba4..a16501a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/entry_queues3.adb: New test.
+
2015-03-04 Ian Lance Taylor <iant@google.com>
* go.test/go-test.exp (go-gc-tests): Skip nilptr test on s390*.
diff --git a/gcc/testsuite/gnat.dg/entry_queues3.adb b/gcc/testsuite/gnat.dg/entry_queues3.adb
new file mode 100644
index 0000000..2108163
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/entry_queues3.adb
@@ -0,0 +1,29 @@
+-- { dg-do compile }
+
+procedure Entry_Queues3 is
+
+ generic
+ type Large_Range is range <>;
+ package Queue is
+ end;
+
+ package body Queue is
+ task T is
+ entry E(Large_Range);
+ end T ;
+
+ task body T is
+ begin
+ accept E(Large_Range'First) do
+ null;
+ end e ;
+ end T ;
+ end Queue;
+
+ type Large_Range is range 0 .. Long_Integer'Last;
+
+ package My_Queue is new Queue(Large_Range); -- { dg-warning "warning" }
+
+begin
+ null;
+end;