diff mbox series

[Ada] Fix PR ada/98228

Message ID 3409664.rlIHZOMPDm@fomalhaut
State New
Headers show
Series [Ada] Fix PR ada/98228 | expand

Commit Message

Eric Botcazou Jan. 26, 2021, 6:08 p.m. UTC
This is the profiled bootstrap failure for s390x/Linux on the mainline, which 
has been introduced by the modref pass but actually exposing an existing issue 
in the maybe_pad_type function that is visible only on s390x.  Marius did all 
the heavy lifting and posted a fairly extensive investigation report in the 
audit trail (thanks!), so I don't repeat it here; the ultimate issue is too 
weak a test for the addressability of the inner component.

Marius bootstrapped/regtested it on s930x and x86-64 and I conducted a bit 
more testing on my side.  Applied on mainline, 10 and 9 branches.


2021-01-26  Eric Botcazou  <ebotcazou@adacore.com>
            Marius Hillenbrand  <mhillen@linux.ibm.com>

	PR ada/98228
	* gcc-interface/utils.c (maybe_pad_type): Test the size of the new
	packable type instead of its alignment for addressability's sake.
diff mbox series

Patch

diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 494f60e0879..95e509c6e8b 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1571,7 +1571,7 @@  maybe_pad_type (tree type, tree size, unsigned int align,
     {
       tree packable_type = make_packable_type (type, true, align);
       if (TYPE_MODE (packable_type) != BLKmode
-	  && align >= TYPE_ALIGN (packable_type))
+	  && compare_tree_int (TYPE_SIZE (packable_type), align) <= 0)
         type = packable_type;
     }