Provide extra checking for phi argument access from edge
commitb77161e60bce7b4416319defe5f141f14fd375c4
authorRichard Biener <rguenther@suse.de>
Fri, 14 Jul 2023 08:01:39 +0000 (14 10:01 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 14 Jul 2023 08:35:41 +0000 (14 10:35 +0200)
tree6a7a4fbb249e39904b4929e69ec18d60cd40532b
parent407d68daed00e040a7d9545b2a18aa27bf93a106
Provide extra checking for phi argument access from edge

The following adds checking that the edge we query an associated
PHI arg for is related to the PHI node.  Triggered by questionable
code in one of my reviews.

* gimple.h (gimple_phi_arg): New const overload.
(gimple_phi_arg_def): Make gimple arg const.
(gimple_phi_arg_def_from_edge): New inline function.
* tree-phinodes.h (gimple_phi_arg_imm_use_ptr_from_edge):
Likewise.
* tree-ssa-operands.h (PHI_ARG_DEF_FROM_EDGE): Direct to
new inline function.
(PHI_ARG_DEF_PTR_FROM_EDGE): Likewise.
gcc/gimple.h
gcc/tree-phinodes.h
gcc/tree-ssa-operands.h