]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
strub: skip emutls after strubm errors
authorAlexandre Oliva <oliva@adacore.com>
Sat, 9 Dec 2023 00:41:33 +0000 (21:41 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Sat, 9 Dec 2023 00:41:33 +0000 (21:41 -0300)
The emutls pass requires PROP_ssa, but if the strubm pass (or any
other pre-SSA pass) issues errors, all of the build_ssa_passes are
skipped, so the property is not set, but emutls still attempts to run,
on targets that use it, despite earlier errors, so it hits the
unsatisfied requirement.

Adjust emutls to be skipped in case of earlier errors.

for  gcc/ChangeLog

* tree-emutls.cc: Include diagnostic-core.h.
(pass_ipa_lower_emutls::gate): Skip if errors were seen.

gcc/tree-emutls.cc

index 5dca5a8291356dc18e88fa8373ca0400c4b6e715..38de202717a1a06ccc2837aea636711bfc58bd91 100644 (file)
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "tree-iterator.h"
 #include "gimplify.h"
+#include "diagnostic-core.h" /* for seen_error */
 
 /* Whenever a target does not support thread-local storage (TLS) natively,
    we can emulate it with some run-time support in libgcc.  This will in
@@ -841,7 +842,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