public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rs6000: Fix check_effective_target_rop_ok [PR103556, PR103586]
@ 2021-12-07 18:20 Peter Bergner
  2021-12-07 21:22 ` Peter Bergner
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Bergner @ 2021-12-07 18:20 UTC (permalink / raw)
  To: Segher Boessenkool, David Edelsohn; +Cc: GCC Patches

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 {}.

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 7956c387c55..50eef9d453b 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rs6000: Fix check_effective_target_rop_ok [PR103556, PR103586]
  2021-12-07 18:20 [PATCH] rs6000: Fix check_effective_target_rop_ok [PR103556, PR103586] Peter Bergner
@ 2021-12-07 21:22 ` Peter Bergner
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Bergner @ 2021-12-07 21:22 UTC (permalink / raw)
  To: Segher Boessenkool, David Edelsohn; +Cc: GCC Patches

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-07 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07 18:20 [PATCH] rs6000: Fix check_effective_target_rop_ok [PR103556, PR103586] Peter Bergner
2021-12-07 21:22 ` Peter Bergner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).