gnu-tm avoids ICE on invalid code in pass_ipa_tm::gate.
Fixes an internal compiler error in gnu-tm when encountering invalid code.
This commit resolves an internal compiler error (ICE) in the gnu-tm subsystem that occurred when the pass_ipa_tm::gate function executed on invalid code. By adding a check to prevent the gate from running on invalid code, the compiler now handles such cases gracefully. A new test case has been added to ensure this fix.
In Details
The pass_ipa_tm::gate function in GCC's Transactional Memory (TM) implementation was triggering an ICE when presented with invalid code. This patch modifies the gate function in trans-mem.cc to ensure it does not execute its logic when faced with such invalid input, thereby preventing the crash. This addresses PR 128491 and ensures robustness of the IPA pass for TM.
- ICE
- Internal Compiler Error, a condition where the compiler encounters a situation it cannot handle and terminates abnormally.
- pass_ipa_tm
- A GCC compiler pass related to Interprocedural Analysis (IPA) for Transactional Memory (TM).
- gate
- In the context of GCC compiler passes, a 'gate' function typically checks if a pass should be run on a given function or code region.