On Dec  7, 2023, FX Coudert <fxcoud...@gmail.com> wrote:

> The commit
> https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=f0a90c7d7333fc7f554b906245c84bdf04d716d7
> (Introduce strub: machine-independent stack scrubbing) has introduced
> many test failures on x86_64-apple-darwin21:

Nevermind, the followup patch I'd suggested won't help..  The problem is
that after the (expected) errors issued by strub mode pass for those
tests.  The passes that convert the function to SSA mode (and thus
provide the SSA pass property required by emutls) don't run, but emutls
doesn't have the same '&& !seen_error()' condition in its gate function,
so it tries to run, and finds that the required properties aren't there.

This patchlet should cure it.  Testing...

diff --git a/gcc/tree-emutls.cc b/gcc/tree-emutls.cc
index 5dca5a8291356..871e5a14f1e38 100644
--- a/gcc/tree-emutls.cc
+++ b/gcc/tree-emutls.cc
@@ -841,7 +841,7 @@ public:
   bool gate (function *) final override
     {
       /* If the target supports TLS natively, we need do nothing here.  */
-      return !targetm.have_tls;
+      return !targetm.have_tls && !seen_error ();
     }
 
   unsigned int execute (function *) final override

-- 
Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
   Free Software Activist                   GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity
Excluding neuro-others for not behaving ""normal"" is *not* inclusive

Reply via email to