Fix PR rtl-optimization/51667
Eric Botcazou
ebotcazou@adacore.com
Tue Dec 27 18:27:00 GMT 2011
This fixes an oversight we made when turning the original ZEE pass into the
more general REE pass. In the former, all extensions considered were of the
same kind (zero-extension from SImode to DImode) whereas, in the latter, they
can be of any kind. The code was implicitly relying on the former property.
The patch makes is so that each definition insn is associated with only one
kind of extension; this is obviously quite conservative, but still strictly
more powerful than the original pass. In the process, several convoluted
implementation patterns are replaced with more straightforward ones.
Bootstrapped/regtested on x86_64-suse-linux, applied on the mainline.
2011-12-27 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/51667
* ree.c (insn_merge_code): Delete.
(is_insn_merge_attempted): Likewise.
(get_insn_status): Likewise.
(set_insn_status): Likewise.
(struct ext_cand): Add CODE and MODE fields.
(combine_set_extend): Rename to...
(combine_set_extension): ...this. Use above fields and tidy up.
(transform_ifelse): Likewise.
(get_defs): Return the chain of definitions.
(is_this_a_cmove): Merge into...
(is_cond_copy_insn): ...this. Return bool.
(make_defs_and_copies_lists): Adjust calls to get_defs and simplify.
(merge_def_and_ext): Adjust call to combine_set_extend.
(combine_reaching_defs): Remove calls to {g|s}et_insn_status.
(struct extend_info): Rename to...
(struct re_info): ...this. Add DEF_MAP field.
(add_ext_candidate): Merge into...
(add_removable_extension): ...this. Adjust calls to get_defs. Ensure
reaching definitions are associated with only one kind of extension.
(find_removable_extensions): Create and destroy the definition map.
(find_and_remove_re): Return void. Change 'long' variables to 'int'.
Do not deal with is_insn_merge_attempted.
2011-12-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/execute/20111227-1.c: New test.
--
Eric Botcazou
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr51667.diff
Type: text/x-patch
Size: 31904 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111227/c0aa3ded/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20111227-1.c
Type: text/x-csrc
Size: 413 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111227/c0aa3ded/attachment-0001.bin>
More information about the Gcc-patches
mailing list