]> git.ipfire.org Git - thirdparty/gcc.git/commit
mode-switching: Tweak entry/exit handling
authorRichard Sandiford <richard.sandiford@arm.com>
Sat, 11 Nov 2023 17:28:57 +0000 (17:28 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Sat, 11 Nov 2023 17:28:57 +0000 (17:28 +0000)
commite59ec35276599805cdc6c3979d8a167b027d286e
tree9e278d59c51042ec594b7b2b2f12bbfc5c99b19a
parent335b55f4146c5ef9e3bf4bcb7e58e887c3150b02
mode-switching: Tweak entry/exit handling

An entity isn't transparent in a block that requires a specific mode.
optimize_mode_switching took that into account for normal insns,
but didn't for the exit block.  Later patches misbehaved because
of this.

In contrast, an entity was correctly marked as non-transparent
in the entry block, but the reasoning seemed a bit convoluted.
It also referred to a function that no longer exists.
Since KILL = ~TRANSP, the entity is by definition not transparent
in a block that defines the entity, so I think we can make it so
without comment.

Finally, the exit handling was nested in the entry handling,
but that doesn't seem necessary.  A target could say that an
entity is undefined on entry but must be defined on return,
on a "be liberal in what you accept, be conservative in what
you do" principle.

gcc/
* mode-switching.cc (optimize_mode_switching): Mark the exit
block as nontransparent if it requires a specific mode.
Handle the entry and exit mode as sibling rather than nested
concepts.  Remove outdated comment.
gcc/mode-switching.cc