[Ada] Fix inter-unit inlining failure

Eric Botcazou ebotcazou@adacore.com
Mon Oct 10 09:49:00 GMT 2016


This is a regression present on the mainline and 6 branch: the compiler fails 
to inline across units a function declared with pragma Inline_Always because 
the middle-end detects a type mismatch for an argument, after gimplification 
removed a conversion.  The fix is to make the conversion more robust.

Tested on x86_64-suse-linux, applied on mainline and 6 branch.


2016-10-10  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/utils2.c (find_common_type): Do not return the LHS
	type if it's an array with non-constant lower bound and the RHS type
	is an array with a constant one.


2016-10-10  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/inline13.ad[sb]: New test.
	* gnat.dg/inline13_pkg.ad[sb]: New helper.

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline13.adb
Type: text/x-adasrc
Size: 436 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161010/e74c079f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline13.ads
Type: text/x-adasrc
Size: 154 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161010/e74c079f/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline13_pkg.adb
Type: text/x-adasrc
Size: 148 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161010/e74c079f/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline13_pkg.ads
Type: text/x-adasrc
Size: 189 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161010/e74c079f/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 2707 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161010/e74c079f/attachment-0004.bin>


More information about the Gcc-patches mailing list