rs6000: Fix check_effective_target_rop_ok [PR103556, PR103586]
Commit Message
The new rop_ok effective target test doesn't correctly compute its expression
result. Solution is to wrap the test within a expr {} statement.
This has been verified to work on both powerpc64le-linux and powerpc64-linux.
The original test case accidentally worked on LE, but failed on BE. Now we
correctly run the rop tests on LE and mark them as UNSUPPORTED on BE.
Ok for trunk?
Peter
gcc/testsuite/
PR target/103556
PR target/103586
* lib/target-supports.exp (check_effective_target_rop_ok): Use expr {}.
Comments
On 12/7/21 12:20 PM, Peter Bergner wrote:
> proc check_effective_target_rop_ok { } {
> - return [check_effective_target_power10_ok]
> - && [check_effective_target_powerpc_elfv2]
> + return [expr { [check_effective_target_power10_ok]
> + && [check_effective_target_powerpc_elfv2] }]
Speaking with Segher offline, he mentioned that a newline ends a
statement, so the easiest "fix" is to just place the original code
on one line. That was approved by Segher and committed. Thanks.
Peter
@@ -6631,8 +6631,8 @@ proc check_effective_target_powerpc_elfv2 { } {
# Return 1 if this is a PowerPC target supporting -mrop-protect
proc check_effective_target_rop_ok { } {
- return [check_effective_target_power10_ok]
- && [check_effective_target_powerpc_elfv2]
+ return [expr { [check_effective_target_power10_ok]
+ && [check_effective_target_powerpc_elfv2] }]
}
# The VxWorks SPARC simulator accepts only EM_SPARC executables and