https://gcc.gnu.org/g:5c1f687288ec89d9884186df8998c850b43a6a2d

commit r14-10593-g5c1f687288ec89d9884186df8998c850b43a6a2d
Author: Torbjörn SVENSSON <torbjorn.svens...@foss.st.com>
Date:   Fri Aug 16 16:10:01 2024 +0200

    testsuite: Add -fno-short-enums to pr97315-1.C
    
    The test case assumes that sizeof(tree_code) >= 2. On some targets, like
    Cortex-M on arm-none-eabi, -fshort-enums is enabled by default and in
    that case, sizeof(tree_code) will be 1 and the following warning is
    emitted:
    
    .../pr97315-1.C:8:13: warning: width of 'tree_base::code' exceeds its type
    
    Avoid the warning by forcing -fno-short-enums.
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/opt/pr97315-1.C: Add -fno-short-enums.
    
    Signed-off-by: Torbjörn SVENSSON <torbjorn.svens...@foss.st.com>
    (cherry picked from commit 10bf0357750972e20dc702997f2930eab1c1be17)

Diff:
---
 gcc/testsuite/g++.dg/opt/pr97315-1.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.dg/opt/pr97315-1.C 
b/gcc/testsuite/g++.dg/opt/pr97315-1.C
index 5a618d8e1e8..3e439c5f179 100644
--- a/gcc/testsuite/g++.dg/opt/pr97315-1.C
+++ b/gcc/testsuite/g++.dg/opt/pr97315-1.C
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -fno-exceptions" } */
+/* { dg-options "-O3 -fno-exceptions -fno-short-enums" } */
 
 typedef struct tree_node *tree;
 enum tree_code { RECORD_TYPE, QUAL_UNION_TYPE };

Reply via email to