aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-05-25 21:30:39 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-05-25 21:30:39 +0000
commitf42dd37fa3903399388c85c7dd0d9d8f5509cf77 (patch)
tree502fa6bce201997d26c34ad7d2c94b174b22136e /gcc
parent1366ba411aced82547671901bf20655b40e3dded (diff)
downloadgcc-f42dd37fa3903399388c85c7dd0d9d8f5509cf77.zip
gcc-f42dd37fa3903399388c85c7dd0d9d8f5509cf77.tar.gz
gcc-f42dd37fa3903399388c85c7dd0d9d8f5509cf77.tar.bz2
utils.c (maybe_pad_type): Do not apply adjustment to original size for elementary types before issuing...
* gcc-interface/utils.c (maybe_pad_type): Do not apply adjustment to original size for elementary types before issuing the size warning. From-SVN: r223657
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog10
-rw-r--r--gcc/ada/gcc-interface/utils.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gnat.dg/specs/alignment2.ads2
-rw-r--r--gcc/testsuite/gnat.dg/warn11.adb14
5 files changed, 31 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 05b1edf..f75ecf0 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,15 @@
2015-05-25 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/utils.c (maybe_pad_type): Do not apply adjustment to
+ original size for elementary types before issuing the size warning.
+
+2015-05-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * get_targ.adb (C_Get_Float_Words_BE): Adjust import name.
+ (C_Get_Words_BE): Likewise.
+ (C_Get_Bytes_BE): Likewise.
+ (C_Get_Bits_BE): Likewise.
+ (Width_From_Size): Remove superfluous space.
* gcc-interface/targtyps.c (get_float_words_be): Rename into...
(get_target_float_words_be): ...this.
(get_words_be): Rename into...
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index c20378a..291e824 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1426,7 +1426,7 @@ built:
if (CONTAINS_PLACEHOLDER_P (orig_size))
orig_size = max_size (orig_size, true);
- if (align)
+ if (align && AGGREGATE_TYPE_P (type))
orig_size = round_up (orig_size, align);
if (!operand_equal_p (size, orig_size, 0)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3be8bfc..aeb7308 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2015-05-25 Eric Botcazou <ebotcazou@adacore.com>
+ * gnat.dg/warn11.adb: New test.
+ * gnat.dg/specs/alignment2.ads: Add dg-warning directive.
+
+2015-05-25 Eric Botcazou <ebotcazou@adacore.com>
+
* gnat.dg/vfa1_1.adb: New test.
* gnat.dg/vfa1_2.adb: Likewise.
* gnat.dg/vfa1_3.adb: Likewise.
diff --git a/gcc/testsuite/gnat.dg/specs/alignment2.ads b/gcc/testsuite/gnat.dg/specs/alignment2.ads
index 4adffc6..0b6c14f 100644
--- a/gcc/testsuite/gnat.dg/specs/alignment2.ads
+++ b/gcc/testsuite/gnat.dg/specs/alignment2.ads
@@ -43,7 +43,7 @@ package Alignment2 is
-- OK, big size
type I3 is new Integer_32;
- for I3'Size use 32 * 8;
+ for I3'Size use 32 * 8; -- { dg-warning "unused" }
for I3'Alignment use 32;
end Alignment2;
diff --git a/gcc/testsuite/gnat.dg/warn11.adb b/gcc/testsuite/gnat.dg/warn11.adb
new file mode 100644
index 0000000..ff24d7c
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/warn11.adb
@@ -0,0 +1,14 @@
+with Ada.Text_IO; use Ada.Text_IO;
+
+procedure Warn11 is
+
+ type My_Integer is new Integer range 1 .. 10;
+ for My_Integer'Size use 65; -- { dg-warning "unused" }
+
+ type My_Integer2 is new Integer range 1 .. 10;
+ for My_Integer2'Size use 129; -- { dg-warning "unused" }
+
+begin
+ Put_Line ("MB'Size is " & Natural'Image (My_Integer'Size));
+ Put_Line ("MB'Size is " & Natural'Image (My_Integer2'Size));
+end;