analyzer: fix testsuite assumption that sizeof(int) > 2
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 3 Feb 2020 20:39:50 +0000 (15:39 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 4 Feb 2020 15:48:58 +0000 (10:48 -0500)
Fix some failures on xstormy16-elf:
  gcc.dg/analyzer/data-model-1.c  (test for warnings, line 595)
  gcc.dg/analyzer/data-model-1.c  (test for warnings, line 642)
  gcc.dg/analyzer/data-model-1.c  (test for warnings, line 690)
  gcc.dg/analyzer/data-model-1.c  (test for warnings, line 738)

due to:

warning: overflow in conversion from ‘long int’ to ‘int’ changes
  value from ‘100024’ to ‘-31048’ [-Woverflow]
    20 |   p[0].x = 100024;
       |            ^~~~~~

gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/data-model-1.c (struct coord): Convert fields
from int to long.

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/analyzer/data-model-1.c

index 7ce58af..d2dc664 100644 (file)
@@ -1,3 +1,8 @@
+2020-02-04  David Malcolm  <dmalcolm@redhat.com>
+
+       * gcc.dg/analyzer/data-model-1.c (struct coord): Convert fields
+       from int to long.
+
 2020-02-04  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/93538
index 3f92594..d75b9fa 100644 (file)
@@ -171,8 +171,8 @@ int test_12c (void)
 
 struct coord
 {
-  int x;
-  int y;
+  long x;
+  long y;
 };
 
 int test_12d (struct coord c)