Remove left-overs from RTX_UNCHANGING_P era

Eric Botcazou ebotcazou@adacore.com
Thu Mar 20 11:40:00 GMT 2014


While investigating PR rtl-opt/60452, I stumbled upon left-overs of the 
RTX_UNCHANGING_P era, in the form the following idiom:

      target
	= assign_temp (build_qualified_type (type, (TYPE_QUALS (type)
						    | (TREE_READONLY (exp)
						       * TYPE_QUAL_CONST))),
		       TREE_ADDRESSABLE (exp), 1);
      target = assign_temp (type, TREE_ADDRESSABLE (exp), 1);

with 'target' being stored to just after.  This used to be correct with 
RTX_UNCHANGING_P which roughly meant "read-only except for the first access 
which can be a write" and assign_stack_temp_for_type used to contain:

  RTX_UNCHANGING_P (slot)
    = (lang_hooks.honor_readonly && TYPE_READONLY (type));

but is not correct in the current RTL world anymore (as a matter of fact, the 
4 examples are all dead code since TYPE_READONLY isn't used anymore, verified 
on the compiler proper at -O2 that there is not a single byte changed in the 
generated code).

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


2014-03-20  Eric Botcazou  <ebotcazou@adacore.com>

	* calls.c (store_one_arg): Remove incorrect const qualification on the
	type of the temporary.
	* cfgexpand.c (expand_return): Likewise.
	* expr.c (expand_constructor): Likewise.
	(expand_expr_real_1): Likewise.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 2638 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140320/9bf3a714/attachment.bin>


More information about the Gcc-patches mailing list