Bug in alias analysis
Unruh, Erwin
Erwin.Unruh@fujitsu-siemens.com
Thu May 23 01:27:00 GMT 2002
Hello,
I have found an error in the alias analysis. It occurs when ptr_mode and Pmode
have different sizes. The scenario:
- a symbol_ref is constructed, with Pmode == DImode (symbol_ref:DI)
- The rtl is converted to ptr_mode == SImode
- function convert_memory_address now constructs a symbol_ref:SI
while optimizing (cse pass) cse_insn indirectly calls true_dependance.
- this calls base_alias_check
- this extracts (via find_base_term) the symbol_ref parts.
- one of them got through the conversion above and is symbol_ref:SI
the other is unchanged and is a symbol_ref:DI
Now rtx_equal_p is called and it doesn't recognize the similarity because of the
mode difference.
Now my question: what is the best way to handle the problem?
- Avoid the generation of a symbol_ref:SI
- handle mode problems in find_base_term
- add another check in base_alias_check
- modify rtx_equal_p to allow mode differences in symbol_ref
Do you have an advice?
Erwin
Erwin Unruh, Fujitsu Siemens Computers, C/C++ compiler group
More information about the Gcc-bugs
mailing list