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
This commit is contained in:
Eric Botcazou 2015-03-04 22:33:41 +00:00
parent 8ed4390c3f
commit d10a61fbe8
5 changed files with 44 additions and 10 deletions

View File

@ -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>

View File

@ -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);
}
}

View File

@ -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)

View File

@ -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*.

View File

@ -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;