[gcc r12-3502] c++: Fix warning on 32-bit x86

Jason Merrill jason@gcc.gnu.org
Tue Sep 14 03:16:51 GMT 2021


https://gcc.gnu.org/g:22abfa3166c9af1a2a24fae8a2e5d45f4bc6950d

commit r12-3502-g22abfa3166c9af1a2a24fae8a2e5d45f4bc6950d
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Sep 13 22:35:18 2021 -0400

    c++: Fix warning on 32-bit x86
    
    My C++17 hardware interference sizes patch caused a bogus warning on 32-bit
    x86, where we have a default L1 cache line size of 0, and the front end
    complained that the default constructive interference size of 64 was larger
    than that.
    
    gcc/cp/ChangeLog:
    
            * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
            size is smaller than maxalign.

Diff:
---
 gcc/cp/decl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index c2065027369..930531ac0c8 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4776,7 +4776,8 @@ cxx_init_decl_processing (void)
       if (param_construct_interfere_size < max_align)
 	error ("%<--param constructive-interference-size=%d%> is less than "
 	       "%d", param_construct_interfere_size, max_align);
-      else if (param_construct_interfere_size > param_l1_cache_line_size)
+      else if (param_construct_interfere_size > param_l1_cache_line_size
+	       && param_l1_cache_line_size >= max_align)
 	warning (OPT_Winterference_size,
 		 "%<--param constructive-interference-size=%d%> "
 		 "is greater than %<--param l1-cache-line-size=%d%>",


More information about the Gcc-cvs mailing list