Fix ICE on pragma Loop_Optimize in Ada

Eric Botcazou ebotcazou@adacore.com
Sat Nov 15 14:59:00 GMT 2014


The attached testcase triggers an ICE because it contains pragma Loop_Optimize 
which survives down to RTL expansion.  There are 2 bugs: first, this should 
not ICE but issue a "ignoring loop annotation" message (this was accidentally 
disabled in https://gcc.gnu.org/ml/gcc-patches/2014-04/msg00681.html) and, 
second, the code must look for IFN_ANNOTATE calls in the latch as well.

Tested on x86_64-suse-linux, applied on the mainline as obvious.


2014-11-15  Eric Botcazou  <ebotcazou@adacore.com>

	* tree-cfg.c (replace_loop_annotate_in_block): New function extracted
	from...
	(replace_loop_annotate): ...here.  Call it on the header and on the
	latch block, if any.  Restore proper behavior of final cleanup.


2014-11-15  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/opt44.ad[sb]: New test.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 3873 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20141115/e3bd9b9e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opt44.adb
Type: text/x-adasrc
Size: 410 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20141115/e3bd9b9e/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opt44.ads
Type: text/x-adasrc
Size: 171 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20141115/e3bd9b9e/attachment-0002.bin>


More information about the Gcc-patches mailing list