This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

At which pass thing goes wrong for PR43491?


Hi,
I looked into PR43491 a while and found in this case the gimple
generated before pre
is like:

reg.0_12 = reg
...
c()
reg.0_1 = reg
D.xxx = MEM[reg.0_1 + 8B]

The pre pass transforms it into:

reg.0_12 = reg
...
c()
reg.0_1 = reg.0_12
D.xxx = MEM[reg.0_1 + 8B]

>From now on, following passes(like copy_prop) can not transform it back and
resulting in an additional mov instruction as the bug reported.

The flow is like:
1, when rewriting gimple into ssa, reg is treated as a memory use;
2, seems pre noticed that reg is const and replace reg with reg.0_12,
    by this pre thinks it has eliminated an additional memory load operation;
3, following passes do not transform it back either because reg is treated
    as mem use or the const attribute is ignored.

I think pre does the right thing given the information it knows, so wondering
at which pass thing starts going wrong and how could this issue be handled?

Thanks very much
-- 
Best Regards.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]