[patch] Fix PR bootstrap/58509

Eric Botcazou ebotcazou@adacore.com
Fri Sep 27 13:54:00 GMT 2013


Hi,

this fixes the ICE during the build of the Ada runtime on the SPARC, a fallout 
of the recent inliner changes:
  http://gcc.gnu.org/ml/gcc-patches/2013-09/msg01033.html

The ICE is triggered because the ldd peephole merges an MEM with MEM_NOTRAP_P 
and a contiguous MEM without MEM_NOTRAP_P, keeping the MEM_NOTRAP_P flag on 
the result.  As a consequence, an EH edge is eliminated and a BB is orphaned.

I think this shows that my above inliner patch was too gross: when you have 
successive inlining, you can quickly end up with a mess of trapping and non-
trapping memory accesses for the same object.  So the attached seriously 
refines it, restricting it to parameters with reference type and leaning 
towards being less conservative.  Again, this should only affect Ada.

Tested on x86_64-suse-linux, OK for the mainline?


2013-09-27  Eric Botcazou  <ebotcazou@adacore.com>

	PR bootstrap/58509
	* ipa-prop.h (get_ancestor_addr_info): Declare.
	* ipa-prop.c (get_ancestor_addr_info): Make public.
	* tree-inline.c (is_parm): Rename into...
	(is_ref_parm): ...this.
	(is_based_on_ref_parm): New predicate.
	(remap_gimple_op_r): Do not propagate TREE_THIS_NOTRAP on MEM_REF if
	a parameter with reference type has been remapped and the result is
	not based on another parameter with reference type.
	(copy_tree_body_r): Likewise on INDIRECT_REF and MEM_REF.


2013-09-27  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/specs/opt1.ads: New test.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr58509.diff
Type: text/x-patch
Size: 5299 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130927/c25ce267/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opt1.ads
Type: text/x-adasrc
Size: 455 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130927/c25ce267/attachment-0001.bin>


More information about the Gcc-patches mailing list