public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf
@ 2018-11-14 15:41 Jozef Lawrynowicz
  2018-11-14 15:44 ` [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives " Jozef Lawrynowicz
                   ` (10 more replies)
  0 siblings, 11 replies; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-14 15:41 UTC (permalink / raw)
  To: GCC Patches; +Cc: Nick Clifton

The following series of patches fixes a number of test failures when running
the GCC DejaGNU testsuite for msp430-elf.

The raw output from contrib/compare_tests is a bit misleading for some tests,
as lines have been added to the source code, changing line numbers for
dg-warning/dg-error tests. I verified there are no regressions
or new failures for x86_64-pc-linux-gnu (gcc, g++), avr (gcc) and msp430-elf
with the small and large memory model (gcc, g++).

For the msp430 small memory model (default) here are the summary results:

BEFORE:
         === gcc Summary ===
         
         # of expected passes            90663
         # of unexpected failures        447
         # of unexpected successes       6
         # of expected failures          287
         # of unresolved testcases       93
         # of unsupported tests          4171
         
         === g++ Summary ===
         
         # of expected passes            99772
         # of unexpected failures        2673
         # of expected failures          433
         # of unresolved testcases       1812
         # of unsupported tests          5862

AFTER:
         === gcc Summary ===

         # of expected passes            90750
         # of unexpected failures        150
         # of unexpected successes       3
         # of expected failures          295
         # of unresolved testcases       14
         # of unsupported tests          4313

         === g++ Summary ===

         # of expected passes            99804
         # of unexpected failures        706
         # of expected failures          436
         # of unresolved testcases       46
         # of unsupported tests          7778

For the -mlarge configuration here are the summary results:
BEFORE:
         === gcc Summary ===

         # of expected passes            90451
         # of unexpected failures        590
         # of unexpected successes       7
         # of expected failures          286
         # of unresolved testcases       162
         # of unsupported tests          4172

         === g++ Summary ===

         # of expected passes            99509
         # of unexpected failures        2885
         # of expected failures          433
         # of unresolved testcases       1875
         # of unsupported tests          5862

AFTER:
         === gcc Summary ===

         # of expected passes            90641
         # of unexpected failures        154
         # of unexpected successes       3
         # of expected failures          293
         # of unresolved testcases       32
         # of unsupported tests          4355

         === g++ Summary ===

         # of expected passes            99529
         # of unexpected failures        949
         # of expected failures          436
         # of unresolved testcases       128
         # of unsupported tests          7759


The "before" results do not include the "obvious" testsuites changes committed
in r265924, r265926, r265927, r265928,
(https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00618.html)
but the "after" results do.

Patch 1 tweaks dg directives in tests specifically for msp430. Many of
these are extensions to existing target selectors in dg directives.

Patch 2 fixes issues finding libssp when linking tests or checking for
fstack_protector support.

Patch 3 sets up require-effective-target directives for tests which
require the compilation of large arrays.
Targets which have 16-bit or 20-bit size_t fail to compile tests with large
arrays designed to test 32-bit or 64-bit behaviour. Rather than enumerating
another target to skip, I've replaced the target selector in some tests with
a size checking procedure:
- size20plus (new)
- size32plus
size20plus checks to see if a 16-bit structure/array size is supported,
similarly to how the existing size32plus checks to see if a 24-bit
structure/array size is supported,

Patch 4 fixes tests when int is 16-bits by default.

Patch 5 deals with ISO C errors emitted by tests when the large memory model is
used. size_t and ptrdiff_t are __int20 with -mlarge, and if the test is
compiled with -pedantic-errors and -std=* or -ansi, then use of these types
causes an error of the form:
   ISO C does not support __int20 types
I fixed this by adding dg-prune-output directives to tests which cause this
error.
Alternatively, I considered adding typedefs preceded by  __extension__ to fix
these errors, but in many cases __SIZE_TYPE__ is directly used so replacing all
these with a new typedef'd type changes the code in more places, in some cases
changing the offset for dg-warning or dg-error directives. Changing the line
numbers for dg-warning/dg-error adds further manual steps to comparing
testresults and as these are generic tests I wanted to minimize the effect on
the testresults for other targets.

Patch 6 fixes tests expecting printf float support for targets which have been
configured with "newlib-nano-formatted-io". When newlib is configured in this
way, float printf is enabled at build time by registering _printf_float as an
undefined symbol.

Patch 7 fixes tests for msp430-elf in the large memory model.

Ok for trunk?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-14 15:41 [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf Jozef Lawrynowicz
@ 2018-11-14 15:44 ` Jozef Lawrynowicz
  2018-11-14 16:31   ` Paul Koning
  2018-11-14 16:54   ` Andreas Schwab
  2018-11-14 15:47 ` [PATCH 2/7][MSP430][TESTSUITE] Add path to libssp to the linker search path when checking for -fstack-protector support Jozef Lawrynowicz
                   ` (9 subsequent siblings)
  10 siblings, 2 replies; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-14 15:44 UTC (permalink / raw)
  To: GCC Patches; +Cc: Nick Clifton

[-- Attachment #1: Type: text/plain, Size: 140 bytes --]

Patch 1 tweaks dg directives in tests specifically for msp430. Many of
these are extensions to existing target selectors in dg directives.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-TESTSUITE-MSP430-Tweak-dg-directives-for-msp430-elf.patch --]
[-- Type: text/x-patch; name="0001-TESTSUITE-MSP430-Tweak-dg-directives-for-msp430-elf.patch", Size: 23883 bytes --]

From a730d945647923c5c10e8487ca3c2a24511abf3d Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Thu, 8 Nov 2018 18:55:57 +0000
Subject: [PATCH 1/7] [TESTSUITE][MSP430] Tweak dg-directives for msp430-elf

2018-11-14  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/testsuite/ChangeLog:

	* c-c++-common/pr41779.c: Skip for msp430.
	* gcc.dg/Wno-frame-address.c: Likewise.
	* gcc.dg/torture/stackalign/builtin-apply-2.c: Likewise.
	* gcc.dg/ifcvt-4.c: Likewise.
	* gcc.dg/pr34856.c: Likewise.
	* gcc.dg/pr84670-4.c: Likewise.
	* gcc.dg/pr85859.c: Likewise.
	* gcc.dg/builtin-apply2.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-26.c: Likewise.
	* c-c++-common/pr57371-2.c: XFAIL optimized dump scan for msp430.
	* c-c++-common/torture/builtin-arith-overflow-10.c: Increase timeout
	for msp430.
	* c-c++-common/torture/builtin-arith-overflow-p-10.c: Likewise.
	* gcc.c-torture/execute/arith-rand-ll.c: Likewise.
	* gcc.dg/attr-alloc_size-11.c: Remove dg-warning XFAIL for msp430.
	* gcc.dg/tree-ssa/20040204-1.c: Likewise.
	* gcc.dg/compat/struct-by-value-16a_x.c: Build at -O1 for msp430
	so it fits.
	* gcc.dg/lto/20091013-1_1.c: Add xfail-if for msp430.
	* gcc.dg/lto/20091013-1_2.c: Likewise.
	* gcc.dg/tree-ssa/loop-1.c: Fix expected dg-final behaviour for msp430.
	* gcc.dg/tree-ssa/gen-vect-25.c: Likewise.
	* gcc.dg/tree-ssa/gen-vect-11.c: Likewise.
	* gcc.dg/tree-ssa/loop-35.c: Likewise.
	* gcc.dg/tree-ssa/pr23455.c: Likewise.
	* gcc.dg/weak/typeof-2.c: Likewise.
	* gcc.target/msp430/interrupt_fn_placement.c: Skip for 430 ISA.
	* gcc.target/msp430/pr78818-data-region.c: Fix scan-assembler text.
	* gcc.target/msp430/pr79242.c: Don't skip for -msmall.
	* gcc.target/msp430/special-regs.c: Use "__asm__" instead of "asm".
	* lib/target-supports.exp
	(check_effective_target_logical_op_short_circuit): Add msp430.
---
 gcc/testsuite/c-c++-common/pr41779.c                             | 3 ++-
 gcc/testsuite/c-c++-common/pr57371-2.c                           | 2 +-
 gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c   | 1 +
 gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-p-10.c | 1 +
 gcc/testsuite/gcc.c-torture/execute/arith-rand-ll.c              | 2 ++
 gcc/testsuite/gcc.dg/Wno-frame-address.c                         | 2 +-
 gcc/testsuite/gcc.dg/attr-alloc_size-11.c                        | 4 ++--
 gcc/testsuite/gcc.dg/builtin-apply2.c                            | 2 +-
 gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c              | 2 ++
 gcc/testsuite/gcc.dg/ifcvt-4.c                                   | 2 +-
 gcc/testsuite/gcc.dg/lto/20091013-1_1.c                          | 2 +-
 gcc/testsuite/gcc.dg/lto/20091013-1_2.c                          | 2 +-
 gcc/testsuite/gcc.dg/pr34856.c                                   | 1 +
 gcc/testsuite/gcc.dg/pr84670-4.c                                 | 1 +
 gcc/testsuite/gcc.dg/pr85859.c                                   | 1 +
 gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c        | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c                       | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c                      | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c                      | 4 ++--
 gcc/testsuite/gcc.dg/tree-ssa/loop-1.c                           | 4 ++--
 gcc/testsuite/gcc.dg/tree-ssa/loop-35.c                          | 4 ++--
 gcc/testsuite/gcc.dg/tree-ssa/pr23455.c                          | 4 ++--
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c                       | 1 +
 gcc/testsuite/gcc.dg/weak/typeof-2.c                             | 2 ++
 gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c         | 1 +
 gcc/testsuite/gcc.target/msp430/pr78818-data-region.c            | 3 ++-
 gcc/testsuite/gcc.target/msp430/pr79242.c                        | 2 +-
 gcc/testsuite/gcc.target/msp430/special-regs.c                   | 8 ++++----
 gcc/testsuite/lib/target-supports.exp                            | 1 +
 29 files changed, 42 insertions(+), 26 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/pr41779.c b/gcc/testsuite/c-c++-common/pr41779.c
index c42a0f5..4ecedec 100644
--- a/gcc/testsuite/c-c++-common/pr41779.c
+++ b/gcc/testsuite/c-c++-common/pr41779.c
@@ -1,6 +1,7 @@
 /* PR41779: Wconversion cannot see through real*integer promotions. */
 /* { dg-do compile } */
-/* { dg-skip-if "doubles are floats" { "avr-*-*" } } */
+/* { dg-skip-if "doubles are floats" { avr-*-* } } */
+/* { dg-skip-if "int is smaller than float" { msp430-*-* } } */
 /* { dg-options "-std=c99 -Wconversion" { target c } } */
 /* { dg-options "-Wconversion" { target c++ } } */
 /* { dg-require-effective-target large_double } */
diff --git a/gcc/testsuite/c-c++-common/pr57371-2.c b/gcc/testsuite/c-c++-common/pr57371-2.c
index d07cff3..9ff83eb 100644
--- a/gcc/testsuite/c-c++-common/pr57371-2.c
+++ b/gcc/testsuite/c-c++-common/pr57371-2.c
@@ -8,7 +8,7 @@
 
 int foo1(int x) {
   return (float) x != 0;
-  /* { dg-final { scan-tree-dump "\\(float\\)" "optimized" } } */
+  /* { dg-final { scan-tree-dump "\\(float\\)" "optimized" { xfail msp430-*-* } } } */
 }
 
 int foo2(long long x) {
diff --git a/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c b/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
index 6b1c427..71d24ce 100644
--- a/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
+++ b/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
@@ -1,6 +1,7 @@
 /* Test __builtin_{add,sub}_overflow on {,un}signed long int.  */
 /* { dg-do run } */
 /* { dg-skip-if "" { ! run_expensive_tests }  { "*" } { "-O0" "-O2" } } */
+/* { dg-timeout 120 { target msp430-*-* } } */
 
 typedef signed long int S;
 typedef unsigned long int U;
diff --git a/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-p-10.c b/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-p-10.c
index bf514dd..c8e178c 100644
--- a/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-p-10.c
+++ b/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-p-10.c
@@ -1,6 +1,7 @@
 /* Test __builtin_{add,sub}_overflow_p on {,un}signed long int.  */
 /* { dg-do run } */
 /* { dg-skip-if "" { ! run_expensive_tests }  { "*" } { "-O0" "-O2" } } */
+/* { dg-timeout 120 { target msp430-*-* } } */
 
 typedef signed long int S;
 typedef unsigned long int U;
diff --git a/gcc/testsuite/gcc.c-torture/execute/arith-rand-ll.c b/gcc/testsuite/gcc.c-torture/execute/arith-rand-ll.c
index 6c3cf18..1fd3a81 100644
--- a/gcc/testsuite/gcc.c-torture/execute/arith-rand-ll.c
+++ b/gcc/testsuite/gcc.c-torture/execute/arith-rand-ll.c
@@ -1,3 +1,5 @@
+/* { dg-timeout 120 { target msp430-*-* } } */
+
 long long
 simple_rand ()
 {
diff --git a/gcc/testsuite/gcc.dg/Wno-frame-address.c b/gcc/testsuite/gcc.dg/Wno-frame-address.c
index 9fe4d07..11ae0cd 100644
--- a/gcc/testsuite/gcc.dg/Wno-frame-address.c
+++ b/gcc/testsuite/gcc.dg/Wno-frame-address.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-skip-if "Cannot access arbitrary stack frames" { arm*-*-* avr-*-* hppa*-*-* ia64-*-* visium-*-* csky-*-* } } */
+/* { dg-skip-if "Cannot access arbitrary stack frames" { arm*-*-* avr-*-* hppa*-*-* ia64-*-* visium-*-* csky-*-* msp430-*-* } } */
 /* { dg-options "-Werror" } */
 /* { dg-additional-options "-mbackchain" { target { s390*-*-* } } } */
 
diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c
index 7f2fc49..0ac787c 100644
--- a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c
+++ b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c
@@ -47,8 +47,8 @@ typedef __SIZE_TYPE__    size_t;
 
 /* The following tests fail because of missing range information.  The xfail
    exclusions are PR79356.  */
-TEST (signed char, SCHAR_MIN + 2, ALLOC_MAX);   /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for signed char" { xfail { ! { aarch64*-*-* arm*-*-* avr-*-* alpha*-*-* ia64-*-* mips*-*-* pdp11*-*-* powerpc*-*-* sparc*-*-* s390*-*-* visium-*-* } } } } */
-TEST (short, SHRT_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for short" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* avr-*-* ia64-*-* mips*-*-* pdp11*-*-* powerpc*-*-* sparc*-*-* s390x-*-* visium-*-* } } } } */
+TEST (signed char, SCHAR_MIN + 2, ALLOC_MAX);   /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for signed char" { xfail { ! { aarch64*-*-* arm*-*-* avr-*-* alpha*-*-* ia64-*-* mips*-*-* pdp11*-*-* powerpc*-*-* sparc*-*-* s390*-*-* visium-*-* msp430-*-* } } } } */
+TEST (short, SHRT_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for short" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* avr-*-* ia64-*-* mips*-*-* pdp11*-*-* powerpc*-*-* sparc*-*-* s390x-*-* visium-*-* msp430-*-* } } } } */
 TEST (int, INT_MIN + 2, ALLOC_MAX);    /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */
 TEST (int, -3, ALLOC_MAX);             /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */
 TEST (int, -2, ALLOC_MAX);             /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */
diff --git a/gcc/testsuite/gcc.dg/builtin-apply2.c b/gcc/testsuite/gcc.dg/builtin-apply2.c
index 3768caa..b73f946 100644
--- a/gcc/testsuite/gcc.dg/builtin-apply2.c
+++ b/gcc/testsuite/gcc.dg/builtin-apply2.c
@@ -1,7 +1,7 @@
 /* { dg-do run } */
 /* { dg-require-effective-target untyped_assembly } */
 /* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { "avr-*-* nds32*-*-*" } } */
-/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs." { "riscv*-*-*" } } */
+/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs." { "riscv*-*-*" msp430-*-* } } */
 /* { dg-skip-if "Variadic funcs use Base AAPCS.  Normal funcs use VFP variant." { arm*-*-* && arm_hf_eabi } } */
 
 /* PR target/12503 */
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
index f563f6e..ac8397b 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
@@ -1,3 +1,5 @@
+/* { dg-options "-O1" { target msp430-*-* } } */
+
 #include "compat-common.h"
 
 #include "fp-struct-defs.h"
diff --git a/gcc/testsuite/gcc.dg/ifcvt-4.c b/gcc/testsuite/gcc.dg/ifcvt-4.c
index 52827ab..ec142cf 100644
--- a/gcc/testsuite/gcc.dg/ifcvt-4.c
+++ b/gcc/testsuite/gcc.dg/ifcvt-4.c
@@ -2,7 +2,7 @@
 /* { dg-additional-options "-misel" { target { powerpc*-*-* } } } */
 /* { dg-additional-options "-march=z196" { target { s390x-*-* } } } */
 /* { dg-additional-options "-mtune-ctrl=^one_if_conv_insn" { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-skip-if "Multiple set if-conversion not guaranteed on all subtargets" { "arm*-*-* avr-*-* hppa*64*-*-* s390-*-* visium-*-*" riscv*-*-* } }  */
+/* { dg-skip-if "Multiple set if-conversion not guaranteed on all subtargets" { "arm*-*-* avr-*-* hppa*64*-*-* s390-*-* visium-*-*" riscv*-*-* msp430-*-* } }  */
 /* { dg-skip-if "" { "s390x-*-*" } { "-m31" } }  */
 
 typedef int word __attribute__((mode(word)));
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_1.c b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
index c958177..71606fd 100644
--- a/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
@@ -1,4 +1,4 @@
-/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" x86_64-*-mingw* } } */
+/* { dg-xfail-if "cast to pointer of different size" { avr-*-* x86_64-*-mingw* msp430-*-* } } */
 typedef struct HDC__ { int unused; } *HDC;
 typedef struct HFONT__ { int unused; } *HFONT;
 
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
index 94a4f72..96f3047 100644
--- a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
@@ -1,4 +1,4 @@
-/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" x86_64-*-mingw* } } */
+/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" x86_64-*-mingw* msp430-*-* } } */
 typedef struct HDC__ { int unused; } *HDC;
 typedef struct HFONT__ { int unused; } *HFONT;
 
diff --git a/gcc/testsuite/gcc.dg/pr34856.c b/gcc/testsuite/gcc.dg/pr34856.c
index 62041e2..9ae8902 100644
--- a/gcc/testsuite/gcc.dg/pr34856.c
+++ b/gcc/testsuite/gcc.dg/pr34856.c
@@ -2,6 +2,7 @@
 /* { dg-options "-O2" } */
 /* { dg-options "-O2 -msse2" { target { i?86-*-* x86_64-*-* } } } */
 /* { dg-options "-O2 -maltivec" { target { powerpc*-*-linux* && powerpc_altivec_ok } } } */
+/* { dg-skip-if "no vector type for PSImode" { msp430-*-* } { "-mlarge" } { "" } } */
 
 typedef __UINTPTR_TYPE__ uintptr_t;
 
diff --git a/gcc/testsuite/gcc.dg/pr84670-4.c b/gcc/testsuite/gcc.dg/pr84670-4.c
index 00bd13a..4b94d1f 100644
--- a/gcc/testsuite/gcc.dg/pr84670-4.c
+++ b/gcc/testsuite/gcc.dg/pr84670-4.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fwrapv" } */
+/* { dg-skip-if "pointer size != long size" { msp430-*-* } } */
 
 char *a;
 int b(void)
diff --git a/gcc/testsuite/gcc.dg/pr85859.c b/gcc/testsuite/gcc.dg/pr85859.c
index 96eb967..65ed635 100644
--- a/gcc/testsuite/gcc.dg/pr85859.c
+++ b/gcc/testsuite/gcc.dg/pr85859.c
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-ftree-tail-merge -Wno-div-by-zero -O2 -fno-dce -fno-isolate-erroneous-paths-dereference -fno-tree-dce -fno-tree-vrp" } */
+/* { dg-skip-if "pointer size != long size" { msp430-*-* } } */
 
 int b, c, d, e;
 
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
index d033010..e7ffe66 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
@@ -9,7 +9,7 @@
 /* arm_hf_eabi: Variadic funcs use Base AAPCS.  Normal funcs use VFP variant.
    avr: Variadic funcs don't pass arguments in registers, while normal funcs
         do.  */
-/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs" { arm_hf_eabi || { avr-*-* riscv*-*-* } } } */
+/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs" { arm_hf_eabi || { avr-*-* msp430-*-* riscv*-*-* } } } */
 /* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { nds32*-*-* } } */
 /* { dg-require-effective-target untyped_assembly } */
    
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
index a1237cf..66ca83f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
@@ -33,4 +33,4 @@ void test55 (int x, int y)
    that the && should be emitted (based on BRANCH_COST).  Fix this
    by teaching dom to look through && and register all components
    as true.  */
-/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* aarch64*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* nds32*-*-* s390*-*-* sh*-*-* sparc*-*-* spu-*-* visium-*-* x86_64-*-* riscv*-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* aarch64*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* nds32*-*-* s390*-*-* sh*-*-* sparc*-*-* spu-*-* visium-*-* x86_64-*-* riscv*-*-* msp430-*-*" } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
index bb5f248..650e73a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
@@ -30,4 +30,4 @@ int main ()
 }
 
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { avr-*-* msp430-*-* } } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
index 5e3ef8d..60ec270 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
@@ -54,5 +54,5 @@ int main (void)
   return main_1 (n + 2, (int *) &n);
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { ! avr-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { ! { avr-*-* msp430-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! { avr-*-* msp430-*-* } } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
index 1862750..6ac6202 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
@@ -43,10 +43,10 @@ int xxx(void)
 /* The SH targets always use separate instructions to load the address
    and to do the actual call - bsr is only generated by link time
    relaxation.  */
-/* CRIS keeps the address in a register.  */
+/* CRIS and MSP430 keep the address in a register.  */
 /* m68k sometimes puts the address in a register, depending on CPU and PIC.  */
 
-/* { dg-final { scan-assembler-times "foo" 5 { xfail hppa*-*-* ia64*-*-* sh*-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* i?86-*-mingw* i?86-*-cygwin* x86_64-*-mingw* visium-*-* nvptx*-*-* } } } */
+/* { dg-final { scan-assembler-times "foo" 5 { xfail hppa*-*-* ia64*-*-* sh*-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* i?86-*-mingw* i?86-*-cygwin* x86_64-*-mingw* visium-*-* nvptx*-*-* msp430-*-* } } } */
 /* { dg-final { scan-assembler-times "foo,%r" 5 { target hppa*-*-* } } } */
 /* { dg-final { scan-assembler-times "= foo"  5 { target ia64*-*-* } } } */
 /* { dg-final { scan-assembler-times "call\[ \t\]*_foo" 5 { target i?86-*-mingw* i?86-*-cygwin* } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
index 4e9d03a..ce63f97 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
@@ -67,5 +67,5 @@ void test4(struct a *A, unsigned LONG b)
     }
 }
 /* long index not hoisted for avr target PR 36561 */
-/* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim2" { xfail { "avr-*-*" } } } } */
-/* { dg-final { scan-tree-dump-times "Executing store motion of" 6 "lim2" { target { "avr-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim2" { xfail { avr-*-* msp430-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 6 "lim2" { target { avr-*-* msp430-*-* } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c b/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c
index fec3540..f336c98 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c
@@ -25,5 +25,5 @@ bi_windup(unsigned int *outbuf, unsigned int bi_buf)
 /* We should eliminate one load of outcnt, which will in turn let us eliminate
    one multiply of outcnt which will in turn let us eliminate
    one add involving outcnt and outbuf.  */
-/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "pre" {target { ! avr-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "pre" {target {   avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "pre" { target { ! { avr-*-* msp430-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "pre" { target avr-*-* msp430-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
index 8e0a24a..32d6389 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-dse1-details -fno-short-enums" } */
+/* { dg-skip-if "temporary variable for constraint_expr is never used" { msp430-*-* } } */
 
 enum constraint_expr_type
 {
diff --git a/gcc/testsuite/gcc.dg/weak/typeof-2.c b/gcc/testsuite/gcc.dg/weak/typeof-2.c
index d4273e3..51995ca 100644
--- a/gcc/testsuite/gcc.dg/weak/typeof-2.c
+++ b/gcc/testsuite/gcc.dg/weak/typeof-2.c
@@ -48,6 +48,8 @@ int bar3 (int x)
 // { dg-final { if [string match m68k-*-* $target_triplet ] {return} } }
 // Likewise for moxie targets.
 // { dg-final { if [string match moxie-*-* $target_triplet ] {return} } }
+// Likewise for msp430 targets.
+// { dg-final { if [string match msp430-*-* $target_triplet ] {return} } }
 // Likewise for Visium targets.
 // { dg-final { if [string match visium-*-* $target_triplet ] {return} } }
 // { dg-final { scan-assembler "baz3.*baz3.*baz3.*baz3.*baz3.*baz3" } }
diff --git a/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c b/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c
index c88bfc3..b8fd5e6 100644
--- a/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c
+++ b/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-skip-if "" { "*-*-*" } { "-mcpu=msp430" } { "" } } */
 /* { dg-options "-mlarge -mcode-region=either -ffunction-sections" } */
 /* { dg-final { scan-assembler-not "\\.either\\.lowtext" } } */
 
diff --git a/gcc/testsuite/gcc.target/msp430/pr78818-data-region.c b/gcc/testsuite/gcc.target/msp430/pr78818-data-region.c
index 22b1fa2..3244c0a 100644
--- a/gcc/testsuite/gcc.target/msp430/pr78818-data-region.c
+++ b/gcc/testsuite/gcc.target/msp430/pr78818-data-region.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mdata-region=either" } */
 
-/* { dg-final { scan-assembler-not "\\.either" } } */
+/* { dg-final { scan-assembler-not "\\.either\\.data" } } */
+/* { dg-final { scan-assembler-not "\\.either\\.bss" } } */
 
 #include "pr78818-real.c"
diff --git a/gcc/testsuite/gcc.target/msp430/pr79242.c b/gcc/testsuite/gcc.target/msp430/pr79242.c
index d7ff8d3..9de8fe0 100644
--- a/gcc/testsuite/gcc.target/msp430/pr79242.c
+++ b/gcc/testsuite/gcc.target/msp430/pr79242.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-skip-if "" { "*-*-*" } { "-mcpu=msp430" "-msmall" } { "" } } */
+/* { dg-skip-if "" { "*-*-*" } { "-mcpu=msp430" } { "" } } */
 /* { dg-options "-mcpu=msp430x" } */
 
 typedef _Complex __int20 C;
diff --git a/gcc/testsuite/gcc.target/msp430/special-regs.c b/gcc/testsuite/gcc.target/msp430/special-regs.c
index c9121e6..a7ae9d0 100644
--- a/gcc/testsuite/gcc.target/msp430/special-regs.c
+++ b/gcc/testsuite/gcc.target/msp430/special-regs.c
@@ -7,10 +7,10 @@ int foo (void)
   register int cg1 __asm__("R2"); /* { dg-error "the register specified for 'cg1' is not general enough" } */
   register int cg2 __asm__("R3"); /* { dg-error "the register specified for 'cg2' is not general enough" } */
 
-  asm("" : "=r"(pc));
-  asm("" : "=r"(sp));
-  asm("" : "=r"(cg1));
-  asm("" : "=r"(cg2));
+  __asm__("" : "=r"(pc));
+  __asm__("" : "=r"(sp));
+  __asm__("" : "=r"(cg1));
+  __asm__("" : "=r"(cg2));
 
   return pc + sp + cg1 + cg2;
 }
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index fd74c04..4966e50 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -8388,6 +8388,7 @@ proc check_effective_target_logical_op_short_circuit {} {
 	 || [istarget crisv32-*-*] || [istarget cris-*-*]
 	 || [istarget csky*-*-*]
 	 || [istarget mmix-*-*]
+	 || [istarget msp430-*-*]
 	 || [istarget s390*-*-*]
 	 || [istarget powerpc*-*-*]
 	 || [istarget nios2*-*-*]
-- 
2.7.4


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 2/7][MSP430][TESTSUITE] Add path to libssp to the linker search path when checking for -fstack-protector support
  2018-11-14 15:41 [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf Jozef Lawrynowicz
  2018-11-14 15:44 ` [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives " Jozef Lawrynowicz
@ 2018-11-14 15:47 ` Jozef Lawrynowicz
  2018-11-14 15:49 ` [PATCH 3/7][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays Jozef Lawrynowicz
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-14 15:47 UTC (permalink / raw)
  To: GCC Patches; +Cc: Nick Clifton

[-- Attachment #1: Type: text/plain, Size: 98 bytes --]

Patch 2 fixes issues finding libssp when linking tests or checking for
fstack_protector support.


[-- Attachment #2: 0002-TESTSUITE-Add-path-to-libssp-to-the-linker-search-pa.patch --]
[-- Type: text/x-patch, Size: 3573 bytes --]

From 6c6f34bae386a5f396e6f9630514fc7080c2f940 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Sun, 11 Nov 2018 14:30:32 +0000
Subject: [PATCH 2/7] [TESTSUITE] Add path to libssp to the linker search path
 when checking for -fstack-protector support

2018-11-14  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/testsuite/ChangeLog:

	lib/g++.exp (g++_link_flags): Append path to libssp to link flags.
	lib/gcc.exp (gcc_link_flags): New.
	(gcc_init): Append gcc_link_flags result to TEST_EXTRA_LIBS. 
	lib/target-supports.exp (check_effective_target_fstack_protector): Pass
	path to libssp as extra flags to check_runtime.
---
 gcc/testsuite/lib/g++.exp             |  4 ++++
 gcc/testsuite/lib/gcc.exp             | 34 ++++++++++++++++++++++++++++++++++
 gcc/testsuite/lib/target-supports.exp |  2 +-
 3 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp
index c0ffcdf..710bc9b 100644
--- a/gcc/testsuite/lib/g++.exp
+++ b/gcc/testsuite/lib/g++.exp
@@ -149,6 +149,10 @@ proc g++_link_flags { paths } {
 	  append flags "-B${gccpath}/libitm/ -L${gccpath}/libitm/.libs"
 	  append ld_library_path ":${gccpath}/libitm/.libs"
       }
+      if [file exists "${gccpath}/libssp/.libs/libssp.a"] {
+	  append flags "-L${gccpath}/libssp/.libs "
+	  append ld_library_path ":${gccpath}/libssp/.libs"
+      }
       append ld_library_path [gcc-set-multilib-library-path $GXX_UNDER_TEST]
     } else {
       global tool_root_dir
diff --git a/gcc/testsuite/lib/gcc.exp b/gcc/testsuite/lib/gcc.exp
index 61e995a..4c5c652 100644
--- a/gcc/testsuite/lib/gcc.exp
+++ b/gcc/testsuite/lib/gcc.exp
@@ -78,6 +78,37 @@ proc gcc_version { } {
 }
 
 #
+# gcc_link_flags -- provide gcc_link_flags, based on g++_link_flags
+# (originally from libgloss.exp) which knows about the gcc tree structure
+#
+
+proc gcc_link_flags { paths } {
+    global ld_library_path
+
+    set gccpath ${paths}
+    set flags ""
+
+    if { $gccpath != "" } {
+	if [file exists "${gccpath}/libssp/.libs/libssp.a"] {
+	    append flags "-L${gccpath}/libssp/.libs "
+	    append ld_library_path ":${gccpath}/libssp/.libs"
+	}
+    } else {
+	global tool_root_dir
+
+	set libssp [lookfor_file ${tool_root_dir} libssp]
+	if { $libssp != "" } {
+	    append flags "-L${libssp} "
+	    append ld_library_path ":${libssp}"
+	}
+    }
+
+    set_ld_library_path_env_vars
+
+    return "$flags"
+}
+
+#
 # gcc_init -- called at the start of each .exp script.
 #
 # There currently isn't much to do, but always using it allows us to
@@ -95,6 +126,7 @@ proc gcc_init { args } {
     global TOOL_EXECUTABLE
     global gcc_warning_prefix
     global gcc_error_prefix
+    global TEST_EXTRA_LIBS
 
     if { $gcc_initialized == 1 } { return; }
 
@@ -114,6 +146,8 @@ proc gcc_init { args } {
     set gcc_error_prefix "(fatal )?error:"
 
     gcc_maybe_build_wrapper "${tmpdir}/gcc-testglue.o"
+
+    append TEST_EXTRA_LIBS "[gcc_link_flags [get_multilibs]]"
 }
 
 #
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 4966e50..093b12a 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1062,7 +1062,7 @@ proc check_effective_target_fstack_protector {} {
 	  char buf[64];
 	  return !strcpy (buf, strrchr (argv[0], '/'));
 	}
-    } "-fstack-protector"]
+    } "-fstack-protector -B[get_multilibs]/libssp/ -L[get_multilibs]/libssp/.libs"]
 }
 
 # Return 1 if the target supports -fstack-check or -fstack-check=$stack_kind
-- 
2.7.4


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 3/7][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays
  2018-11-14 15:41 [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf Jozef Lawrynowicz
  2018-11-14 15:44 ` [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives " Jozef Lawrynowicz
  2018-11-14 15:47 ` [PATCH 2/7][MSP430][TESTSUITE] Add path to libssp to the linker search path when checking for -fstack-protector support Jozef Lawrynowicz
@ 2018-11-14 15:49 ` Jozef Lawrynowicz
  2018-11-26 20:16   ` Mike Stump
  2018-11-14 15:52 ` [PATCH 4/7][MSP430][TESTSUITE] Fix tests when int is 16-bit by default Jozef Lawrynowicz
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-14 15:49 UTC (permalink / raw)
  To: GCC Patches; +Cc: Nick Clifton

[-- Attachment #1: Type: text/plain, Size: 572 bytes --]

Patch 3 sets up require-effective-target directives for tests which
require the compilation of large arrays.
Targets which have 16-bit or 20-bit size_t fail to compile tests with large
arrays designed to test 32-bit or 64-bit behaviour. Rather than enumerating
another target to skip, I've replaced the target selector in some tests with
a size checking procedure:
- size20plus (new)
- size32plus
size20plus checks to see if a 16-bit structure/array size is supported,
similarly to how the existing size32plus checks to see if a 24-bit
structure/array size is supported.


[-- Attachment #2: 0003-TESTSUITE-Dynamically-check-if-size_t-is-large-enoug.patch --]
[-- Type: text/x-patch, Size: 14641 bytes --]

From 23ab77f7e44e104595adb0b5cabd9caf93141ffd Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Thu, 8 Nov 2018 22:39:12 +0000
Subject: [PATCH 3/7] [TESTSUITE] Dynamically check if size_t is large enough
 for tests containing large structs/arrays

2018-11-14  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/testsuite/ChangeLog:

	* gcc.c-torture/compile/20151204.c: Add dg-require-effective-target
	size20plus.
	* gcc.dg/pr34225.c: Likewise.
	* gcc.dg/pr40971.c: Likewise.
	* gcc.dg/pr69071.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-10.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-2.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-3.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-5.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-6.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-7.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-8.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-9.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-11.c: Add dg-require-effective-target
	size32plus.
	* gcc.dg/Walloc-size-larger-than-4.c: Likewise.
	* gcc.dg/Walloc-size-larger-than-5.c: Likewise.
	* gcc.dg/Walloc-size-larger-than-6.c: Likewise.
	* gcc.dg/Walloc-size-larger-than-7.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-1.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-1b.c: Likewise.
	* lib/target-supports.exp (check_effective_target_size20plus): New.
	(check_effective_target_size32plus): Update comment. 

---
 gcc/testsuite/gcc.c-torture/compile/20151204.c      |  2 +-
 gcc/testsuite/gcc.dg/Walloc-size-larger-than-4.c    |  2 +-
 gcc/testsuite/gcc.dg/Walloc-size-larger-than-5.c    |  2 +-
 gcc/testsuite/gcc.dg/Walloc-size-larger-than-6.c    |  2 +-
 gcc/testsuite/gcc.dg/Walloc-size-larger-than-7.c    |  2 +-
 gcc/testsuite/gcc.dg/pr34225.c                      |  1 +
 gcc/testsuite/gcc.dg/pr40971.c                      |  1 +
 gcc/testsuite/gcc.dg/pr69071.c                      |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-11.c |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1b.c |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-2.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-3.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-5.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-6.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-7.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-8.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-9.c  |  3 ++-
 gcc/testsuite/lib/target-supports.exp               | 18 +++++++++++++++---
 20 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/gcc/testsuite/gcc.c-torture/compile/20151204.c b/gcc/testsuite/gcc.c-torture/compile/20151204.c
index 6a46abf..e41f6c1 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20151204.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20151204.c
@@ -1,4 +1,4 @@
-/* { dg-skip-if "Array too big" { "avr-*-*" "pdp11-*-*" } } */
+/* { dg-require-effective-target size20plus } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-4.c b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-4.c
index 4b3a64b..54e43cd 100644
--- a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-4.c
+++ b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-4.c
@@ -1,6 +1,6 @@
 /* PR middle-end/82063 - issues with arguments enabled by -Wall
    { dg-do compile }
-   { dg-skip-if "small address space" { "pdp11-*-*" } }
+   { dg-require-effective-target size32plus }
    { dg-options "-O -Walloc-size-larger-than=1MiB -ftrack-macro-expansion=0" } */
 
 void sink (void*);
diff --git a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-5.c b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-5.c
index 4217ad6..774c4cf 100644
--- a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-5.c
+++ b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-5.c
@@ -1,6 +1,6 @@
 /* PR middle-end/82063 - issues with arguments enabled by -Wall
    { dg-do compile }
-   { dg-skip-if "small address space" { "pdp11-*-*" } }
+   { dg-require-effective-target size32plus }
    { dg-options "-O -Walloc-size-larger-than=1MB -ftrack-macro-expansion=0" } */
 
 void sink (void*);
diff --git a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-6.c b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-6.c
index a46fce7..2dfc663 100644
--- a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-6.c
+++ b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-6.c
@@ -1,6 +1,6 @@
 /* PR middle-end/82063 - issues with arguments enabled by -Wall
    { dg-do compile }
-   { dg-skip-if "small address space" { "pdp11-*-*" } }
+   { dg-require-effective-target size32plus }
    { dg-options "-O -Walloc-size-larger-than=1GiB -ftrack-macro-expansion=0" } */
 
 void sink (void*);
diff --git a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-7.c b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-7.c
index 4d9aafd..2cc517f 100644
--- a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-7.c
+++ b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-7.c
@@ -1,6 +1,6 @@
 /* PR middle-end/82063 - issues with arguments enabled by -Wall
    { dg-do compile }
-   { dg-skip-if "small address space" { "pdp11-*-*" } }
+   { dg-require-effective-target size32plus }
    { dg-options "-O -Walloc-size-larger-than=1GB -ftrack-macro-expansion=0" } */
 
 void sink (void*);
diff --git a/gcc/testsuite/gcc.dg/pr34225.c b/gcc/testsuite/gcc.dg/pr34225.c
index 659e176..e337340 100644
--- a/gcc/testsuite/gcc.dg/pr34225.c
+++ b/gcc/testsuite/gcc.dg/pr34225.c
@@ -2,6 +2,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fno-strict-aliasing -fstack-protector" } */
 /* { dg-require-effective-target fstack_protector } */
+/* { dg-require-effective-target size20plus } */
 
 typedef __SIZE_TYPE__ size_t;
 extern int sscanf (const char *, const char *, ...);
diff --git a/gcc/testsuite/gcc.dg/pr40971.c b/gcc/testsuite/gcc.dg/pr40971.c
index 31dfd5e..4317638 100644
--- a/gcc/testsuite/gcc.dg/pr40971.c
+++ b/gcc/testsuite/gcc.dg/pr40971.c
@@ -2,6 +2,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O -fstack-protector -fno-strict-aliasing" } */
 /* { dg-require-effective-target fstack_protector } */
+/* { dg-require-effective-target size20plus } */
 
 extern void bar (char *);
 
diff --git a/gcc/testsuite/gcc.dg/pr69071.c b/gcc/testsuite/gcc.dg/pr69071.c
index 0396bbc..3ae3811 100644
--- a/gcc/testsuite/gcc.dg/pr69071.c
+++ b/gcc/testsuite/gcc.dg/pr69071.c
@@ -1,7 +1,7 @@
 /* PR target/69071 */
 /* { dg-do compile } */
 /* { dg-options "-O2 -g" } */
-/* { dg-skip-if "Array too big" { "avr-*-*" } } */
+/* { dg-require-effective-target size20plus } */
 
 void *bar (void *);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1.c
index 4a81e12..c7ebaef 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fassociative-math -fno-signed-zeros -fno-trapping-math -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 /* Copied from graphite/interchange-4.c */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c
index 5735756..8f5a9a0 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-11.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-11.c
index 2a1b340..413b81e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-11.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-11.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1b.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1b.c
index 7de2b40..a3063bb 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1b.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1b.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 /* Copied from graphite/interchange-4.c */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-2.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-2.c
index 247adc9..fbd46a2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-2.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 /* Copied from graphite/interchange-5.c */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-3.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-3.c
index b239230..8028e36 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-3.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big stack" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big stack" { visium-*-* } } */
 
 /* Copied from graphite/interchange-6.c */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-5.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-5.c
index 8f13cd4..81050a8 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-5.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M], c[M][M], d[M][M];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-6.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-6.c
index a38fd9d..8a2692e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-6.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M], c[M][M], d[M][M];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-7.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-7.c
index e6ad26f..d55c1e2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-7.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M], c[M][M], d[M][M];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-8.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-8.c
index 5ed300a..391b8a4 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-8.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-8.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M], c[M][M], d[M][M];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-9.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-9.c
index a984e47..b5fda2d 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-9.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-9.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M], c[M], d[M];
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 093b12a..5235d5e 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2600,9 +2600,21 @@ proc check_effective_target_ptr32plus { } {
     }]
 }
 
-# Return 1 if we support 32-bit or larger array and structure sizes
-# using default options, 0 otherwise.  Avoid false positive on
-# targets with 20 or 24 bit address spaces.
+# Return 1 if we support 16-bit or larger array and structure sizes
+# using default options, 0 otherwise.
+# This implies at least a 20-bit address space, as no targets have an address
+# space between 16 and 20 bits.
+
+proc check_effective_target_size20plus { } {
+    return [check_no_compiler_messages size32plus object {
+	char dummy[65537L];
+    }]
+}
+
+# Return 1 if we support 24-bit or larger array and structure sizes
+# using default options, 0 otherwise.
+# This implies at least a 32-bit address space, as no targets have an address
+# space between 24 and 32 bits.
 
 proc check_effective_target_size32plus { } {
     return [check_no_compiler_messages size32plus object {
-- 
2.7.4


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 4/7][MSP430][TESTSUITE] Fix tests when int is 16-bit by default
  2018-11-14 15:41 [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf Jozef Lawrynowicz
                   ` (2 preceding siblings ...)
  2018-11-14 15:49 ` [PATCH 3/7][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays Jozef Lawrynowicz
@ 2018-11-14 15:52 ` Jozef Lawrynowicz
  2018-11-26 20:39   ` Mike Stump
  2018-11-14 15:56 ` [PATCH 5/7][MSP430][TESTSUITE] Prune messages about ISO C not supporting __int20 from output of tests Jozef Lawrynowicz
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-14 15:52 UTC (permalink / raw)
  To: GCC Patches; +Cc: Nick Clifton

[-- Attachment #1: Type: text/plain, Size: 53 bytes --]

Patch 4 fixes tests when int is 16-bits by default.


[-- Attachment #2: 0004-TESTSUITE-Fix-tests-when-int-is-16-bit-by-default.patch --]
[-- Type: text/x-patch, Size: 21955 bytes --]

From 62b273f73cd7a4db22b1161f450ae7267d185890 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Thu, 8 Nov 2018 23:09:38 +0000
Subject: [PATCH 4/7] [TESTSUITE] Fix tests when int is 16-bit by default

2018-11-14  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/testsuite/ChangeLog:

	* c-c++-common/Warray-bounds-3.c (test_strcpy_bounds): Use long instead
	of int if __SIZEOF_INT__ == 2.
	* c-c++-common/Wrestrict.c: Test memcpy range with smaller length when
	__SIZEOF_SIZE_T < 4.
	* c-c++-common/rotate-8.c: Define smaller "large" constant when
	__SIZEOF_INT__ == 2.
	* gcc.dg/pr53037-1.c: Add dg-require-effective-target int32.
	* gcc.dg/pr53037-2.c: Likewise.
	* gcc.dg/pr53037-3.c: Likewise.
	* gcc.dg/pr85512.c: Likewise.
	* gcc.dg/pr59963-2.c: Add dg-warning for int16.
	* gcc.dg/sancov/cmp0.c: Explicitly use __INT32_TYPE__ instead of int.
	* gcc.dg/tree-ssa/addadd.c: Fix dg-final directives for int16.
	* gcc.dg/tree-ssa/pr79327-2.c: Likewise.
	* gcc.dg/tree-ssa/builtin-sprintf-2.c: Filter out invalid tests for
	int16.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-10.c: Update sizes in dg-warning
	directives for int16.

---
 gcc/testsuite/c-c++-common/Warray-bounds-3.c       |  4 +
 gcc/testsuite/c-c++-common/Wrestrict.c             |  5 ++
 gcc/testsuite/c-c++-common/rotate-8.c              | 14 +++-
 gcc/testsuite/gcc.dg/pr53037-1.c                   |  2 +-
 gcc/testsuite/gcc.dg/pr53037-2.c                   |  2 +-
 gcc/testsuite/gcc.dg/pr53037-3.c                   |  2 +-
 gcc/testsuite/gcc.dg/pr59963-2.c                   |  1 +
 gcc/testsuite/gcc.dg/pr85512.c                     |  1 +
 gcc/testsuite/gcc.dg/sancov/cmp0.c                 | 14 +++-
 gcc/testsuite/gcc.dg/tree-ssa/addadd.c             |  4 +-
 gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-2.c  |  9 ++-
 .../gcc.dg/tree-ssa/builtin-sprintf-warn-10.c      | 94 +++++++++++-----------
 gcc/testsuite/gcc.dg/tree-ssa/pr79327-2.c          |  5 +-
 13 files changed, 96 insertions(+), 61 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/Warray-bounds-3.c b/gcc/testsuite/c-c++-common/Warray-bounds-3.c
index 2ee8146..e49d44ad 100644
--- a/gcc/testsuite/c-c++-common/Warray-bounds-3.c
+++ b/gcc/testsuite/c-c++-common/Warray-bounds-3.c
@@ -326,7 +326,11 @@ void test_strcpy_bounds (char *d, const char *s)
 
 struct MA
 {
+#if __SIZEOF_INT__ == 2
+  long i;
+#else
   int i;
+#endif
   char a5[5];
   char a11[11];
 };
diff --git a/gcc/testsuite/c-c++-common/Wrestrict.c b/gcc/testsuite/c-c++-common/Wrestrict.c
index 36a1ffa..efd72ef 100644
--- a/gcc/testsuite/c-c++-common/Wrestrict.c
+++ b/gcc/testsuite/c-c++-common/Wrestrict.c
@@ -262,8 +262,13 @@ void test_memcpy_range (char *d, size_t sz)
   {
     /* Create an offset in the range [0, -1].  */
     size_t o = sz << 1;
+#if __SIZEOF_SIZE_T__ < 4
+    T (d, d + o, 1234);
+    T (d + o, d, 2345);
+#else
     T (d, d + o, 12345);
     T (d + o, d, 23456);
+#endif
   }
 
   /* Exercise memcpy with both destination and source pointer offsets
diff --git a/gcc/testsuite/c-c++-common/rotate-8.c b/gcc/testsuite/c-c++-common/rotate-8.c
index 9ba3e94..f27634a 100644
--- a/gcc/testsuite/c-c++-common/rotate-8.c
+++ b/gcc/testsuite/c-c++-common/rotate-8.c
@@ -5,6 +5,12 @@
 /* { dg-final { scan-tree-dump-times "r\[<>]\[<>]" 23 "optimized" } } */
 /* { dg-final { scan-tree-dump-not "PHI <" "optimized" } } */
 
+#if __SIZEOF_INT__ == 2
+#define LARGE_UNSIGNED 0x1234U
+#else
+#define LARGE_UNSIGNED 0x12345678U
+#endif
+
 unsigned int
 f1 (unsigned int x, unsigned char y)
 {
@@ -60,25 +66,25 @@ f8 (unsigned int x, unsigned char y)
 unsigned int
 f9 (unsigned int x, int y)
 {
-  return (0x12345678U << (y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1))) | (0x12345678U >> (-y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1)));
+  return (LARGE_UNSIGNED << (y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1))) | (LARGE_UNSIGNED >> (-y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1)));
 }
 
 unsigned int
 f10 (unsigned int x, int y)
 {
-  return (0x12345678U >> (-y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1))) | (0x12345678U << (y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1)));
+  return (LARGE_UNSIGNED >> (-y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1))) | (LARGE_UNSIGNED << (y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1)));
 }
 
 unsigned int
 f11 (unsigned int x, int y)
 {
-  return (0x12345678U >> (y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1))) | (0x12345678U << (-y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1)));
+  return (LARGE_UNSIGNED >> (y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1))) | (LARGE_UNSIGNED << (-y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1)));
 }
 
 unsigned int
 f12 (unsigned int x, int y)
 {
-  return (0x12345678U << (-y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1))) | (0x12345678U >> (y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1)));
+  return (LARGE_UNSIGNED << (-y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1))) | (LARGE_UNSIGNED >> (y & (__CHAR_BIT__ * __SIZEOF_INT__ - 1)));
 }
 
 unsigned
diff --git a/gcc/testsuite/gcc.dg/pr53037-1.c b/gcc/testsuite/gcc.dg/pr53037-1.c
index ce0715c..3ea5ae6 100644
--- a/gcc/testsuite/gcc.dg/pr53037-1.c
+++ b/gcc/testsuite/gcc.dg/pr53037-1.c
@@ -1,7 +1,7 @@
 /* PR c/53037.  */
 /* { dg-do compile } */
 /* { dg-options "-O0" } */
-/* { dg-skip-if "" { avr-*-* } } */
+/* { dg-require-effective-target int32 } */
 
 typedef unsigned long long __u64
   __attribute__((aligned(4),warn_if_not_aligned(8)));
diff --git a/gcc/testsuite/gcc.dg/pr53037-2.c b/gcc/testsuite/gcc.dg/pr53037-2.c
index f17fbf7..848db3b 100644
--- a/gcc/testsuite/gcc.dg/pr53037-2.c
+++ b/gcc/testsuite/gcc.dg/pr53037-2.c
@@ -1,7 +1,7 @@
 /* PR c/53037.  */
 /* { dg-do compile } */
 /* { dg-options "-O0 -Wpacked-not-aligned" } */
-/* { dg-skip-if "" { avr-*-* } } */
+/* { dg-require-effective-target int32 } */
 
 struct __attribute__ ((aligned (8))) S8 { char a[8]; };
 struct __attribute__ ((packed)) S1 {
diff --git a/gcc/testsuite/gcc.dg/pr53037-3.c b/gcc/testsuite/gcc.dg/pr53037-3.c
index 6960de0..c9b0efd 100644
--- a/gcc/testsuite/gcc.dg/pr53037-3.c
+++ b/gcc/testsuite/gcc.dg/pr53037-3.c
@@ -1,7 +1,7 @@
 /* PR c/53037.  */
 /* { dg-do compile } */
 /* { dg-options "-O0 -Wall" } */
-/* { dg-skip-if "" { avr-*-* } } */
+/* { dg-require-effective-target int32 } */
 
 struct __attribute__ ((aligned (8))) S8 { char a[8]; };
 struct __attribute__ ((packed)) S1 {
diff --git a/gcc/testsuite/gcc.dg/pr59963-2.c b/gcc/testsuite/gcc.dg/pr59963-2.c
index efd86b0..286a5f9 100644
--- a/gcc/testsuite/gcc.dg/pr59963-2.c
+++ b/gcc/testsuite/gcc.dg/pr59963-2.c
@@ -33,4 +33,5 @@ foo (int i)
                -8); /* { dg-warning "16:-Wsign-conversion" } */
   bazu (i, i); /* { dg-warning "9:conversion" } */
   bazi (0x8, 0x80000000); /* { dg-warning "14:-Wsign-conversion" "" { xfail int16 } } */
+			  /* { dg-warning "overflow in conversion from" "" { target int16 } .-1 } */
 }
diff --git a/gcc/testsuite/gcc.dg/pr85512.c b/gcc/testsuite/gcc.dg/pr85512.c
index b581f83..788ff87 100644
--- a/gcc/testsuite/gcc.dg/pr85512.c
+++ b/gcc/testsuite/gcc.dg/pr85512.c
@@ -1,5 +1,6 @@
 /* { dg-do assemble } */
 /* { dg-options "-O -fno-if-conversion" } */
+/* { dg-require-effective-target int32 } */
 
 typedef unsigned char u8;
 typedef unsigned short u16;
diff --git a/gcc/testsuite/gcc.dg/sancov/cmp0.c b/gcc/testsuite/gcc.dg/sancov/cmp0.c
index 25a166a..8bbf06e 100644
--- a/gcc/testsuite/gcc.dg/sancov/cmp0.c
+++ b/gcc/testsuite/gcc.dg/sancov/cmp0.c
@@ -3,8 +3,14 @@
 /* { dg-options "-fsanitize-coverage=trace-cmp -fdump-tree-optimized" } */
 /* { dg-skip-if "different type layout" { avr-*-* } } */
 
+#if __SIZEOF_INT__ < 4
+typedef __INT32_TYPE__ int32;
+#else
+typedef int int32;
+#endif
+
 void
-foo (char *a, short *b, int *c, long long *d, float *e, double *f)
+foo (char *a, short *b, int32 *c, long long *d, float *e, double *f)
 {
   if (*a)
     *a += 1;
@@ -63,7 +69,7 @@ foo (char *a, short *b, int *c, long long *d, float *e, double *f)
 }
 
 void
-bar (int *c)
+bar (int32 *c)
 {
   if (*c == 27)
     *c += 2;
@@ -71,8 +77,8 @@ bar (int *c)
     *c += 2;
 }
 
-int
-baz (int *c, long long d, long long e)
+int32
+baz (int32 *c, long long d, long long e)
 {
   *c = (*c == 48) ? 12 : 24;
   return d == e;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/addadd.c b/gcc/testsuite/gcc.dg/tree-ssa/addadd.c
index 454ec2a..a586710 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/addadd.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/addadd.c
@@ -25,5 +25,7 @@ int i(int x){
 }
 
 /* { dg-final { scan-tree-dump-times " \\+ 24;" 2 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "\\(unsigned int\\)" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\(unsigned int\\)" 2 "optimized" { target { ! int16 } } } } */
+/* { dg-final { scan-tree-dump-times "\\(unsigned int\\)" 1 "optimized" { target int16 } } } */
+/* { dg-final { scan-tree-dump-times "\\(unsigned short\\)" 1 "optimized" { target int16 } } } */
 /* { dg-final { scan-tree-dump-not "2147483647" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-2.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-2.c
index 75d3db3..7dd5bfd 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-2.c
@@ -78,7 +78,10 @@ EQL (0, 0, "%-s", "");
 EQL (1, 1, "%c",  'x');
 EQL (1, 1, "%-s", "x");
 
+/* Size of character constant must be larger than 2 for this to overflow.  */
+#if __SIZEOF_INT__ > 2
 EQL (1, 2, "%c",  'x');
+#endif
 
 EQL (4, 4, "%4c", 'x');
 
@@ -168,7 +171,11 @@ RNG (0,  4,  6, "%i", i)
 RNG (0,  5,  6, "%i", i)
 RNG (0,  6,  6, "%i", i)
 
+/* If int is 16bit then it will always fit in 7 char characters with this
+   formatting.  */
+#if __SIZEOF_INT__ > 2
 RNG (0,  0,  7, "%i", i)
+#endif
 RNG (0,  1,  7, "%i", i)
 RNG (0,  2,  7, "%i", i)
 RNG (0,  3,  7, "%i", i)
@@ -291,6 +298,6 @@ RNG (0,  6,   8, "%s%ls", "1", L"2");
 /*  Only conditional calls to must_not_eliminate must be made (with
     any probability):
     { dg-final { scan-tree-dump-times "> \\\[local count: \[0-9INV\]*\\\]:\n *must_not_eliminate" 127 "optimized" { target { ilp32 || lp64 } } } }
-    { dg-final { scan-tree-dump-times "> \\\[local count: \[0-9INV\]*\\\]:\n *must_not_eliminate" 96 "optimized" { target { { ! ilp32 } && { ! lp64 } } } } }
+    { dg-final { scan-tree-dump-times "> \\\[local count: \[0-9INV\]*\\\]:\n *must_not_eliminate" 94 "optimized" { target { ! { ilp32 || lp64 } } } } }
     No unconditional calls to abort should be made:
     { dg-final { scan-tree-dump-not ";\n *must_not_eliminate" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-10.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-10.c
index facc023..8e0d695 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-10.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-10.c
@@ -39,17 +39,17 @@ void test_a (int w, int p, double x)
   T1 ("%*.a", 6);     /* { dg-warning "between 6 and 10 bytes" } */
   T1 ("%*.a", 7);     /* { dg-warning "between 7 and 10 bytes" } */
 
-  T1 ("%*.a", w);     /* { dg-warning "writing between 3 and 2147483648 bytes" } */
-  T1 ("%*.0a", w);    /* { dg-warning "writing between 3 and 2147483648 bytes" } */
-  T1 ("%*.1a", w);    /* { dg-warning "writing between 3 and 2147483648 bytes" } */
-  T1 ("%*.2a", w);    /* { dg-warning "writing between 3 and 2147483648 bytes" } */
+  T1 ("%*.a", w);     /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
+  T1 ("%*.0a", w);    /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
+  T1 ("%*.1a", w);    /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
+  T1 ("%*.2a", w);    /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
 
-  T1 ("%.*a",  p);    /* { dg-warning "writing between 3 and 2147483658 bytes" } */
-  T1 ("%1.*a", p);    /* { dg-warning "writing between 3 and 2147483658 bytes" } */
-  T1 ("%2.*a", p);    /* { dg-warning "writing between 3 and 2147483658 bytes" } */
-  T1 ("%3.*a", p);    /* { dg-warning "writing between 3 and 2147483658 bytes" } */
+  T1 ("%.*a",  p);    /* { dg-warning "writing between 3 and (2147483658|32778) bytes" } */
+  T1 ("%1.*a", p);    /* { dg-warning "writing between 3 and (2147483658|32778) bytes" } */
+  T1 ("%2.*a", p);    /* { dg-warning "writing between 3 and (2147483658|32778) bytes" } */
+  T1 ("%3.*a", p);    /* { dg-warning "writing between 3 and (2147483658|32778) bytes" } */
 
-  T2 ("%*.*a", w, p); /* { dg-warning "writing between 3 and 2147483658 bytes" } */
+  T2 ("%*.*a", w, p); /* { dg-warning "writing between 3 and (2147483658|32778) bytes" } */
 }
 
 /* Exercise %e.  */
@@ -69,17 +69,17 @@ void test_e (int w, int p, double x)
   T1 ("%*.e", 6);     /* { dg-warning "between 6 and 7 bytes" } */
   T1 ("%*.e", 7);     /* { dg-warning "writing 7 bytes" } */
 
-  T1 ("%*.e", w);     /* { dg-warning "writing between 3 and 2147483648 bytes" } */
-  T1 ("%*.0e", w);    /* { dg-warning "writing between 3 and 2147483648 bytes" } */
-  T1 ("%*.1e", w);    /* { dg-warning "writing between 3 and 2147483648 bytes" } */
-  T1 ("%*.2e", w);    /* { dg-warning "writing between 3 and 2147483648 bytes" } */
+  T1 ("%*.e", w);     /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
+  T1 ("%*.0e", w);    /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
+  T1 ("%*.1e", w);    /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
+  T1 ("%*.2e", w);    /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
 
-  T1 ("%.*e",  p);    /* { dg-warning "writing between 3 and 2147483655 bytes" } */
-  T1 ("%1.*e", p);    /* { dg-warning "writing between 3 and 2147483655 bytes" } */
-  T1 ("%2.*e", p);    /* { dg-warning "writing between 3 and 2147483655 bytes" } */
-  T1 ("%3.*e", p);    /* { dg-warning "writing between 3 and 2147483655 bytes" } */
+  T1 ("%.*e",  p);    /* { dg-warning "writing between 3 and (2147483655|32775) bytes" } */
+  T1 ("%1.*e", p);    /* { dg-warning "writing between 3 and (2147483655|32775) bytes" } */
+  T1 ("%2.*e", p);    /* { dg-warning "writing between 3 and (2147483655|32775) bytes" } */
+  T1 ("%3.*e", p);    /* { dg-warning "writing between 3 and (2147483655|32775) bytes" } */
 
-  T2 ("%*.*e", w, p); /* { dg-warning "writing between 3 and 2147483655 bytes" } */
+  T2 ("%*.*e", w, p); /* { dg-warning "writing between 3 and (2147483655|32775) bytes" } */
 }
 
 /* Exercise %f.  */
@@ -101,17 +101,17 @@ void test_f (int w, int p, double x)
   T2 ("%*.*f", 312, 312);   /* { dg-warning "between 312 and 623 bytes" } */
   T2 ("%*.*f", 312, 313);   /* { dg-warning "between 312 and 624 bytes" } */
 
-  T1 ("%*.f", w);           /* { dg-warning "writing between 1 and 2147483648 bytes" } */
-  T1 ("%*.0f", w);          /* { dg-warning "writing between 1 and 2147483648 bytes" } */
-  T1 ("%*.1f", w);          /* { dg-warning "writing between 3 and 2147483648 bytes" } */
-  T1 ("%*.2f", w);          /* { dg-warning "writing between 3 and 2147483648 bytes" } */
+  T1 ("%*.f", w);           /* { dg-warning "writing between 1 and (2147483648|32768) bytes" } */
+  T1 ("%*.0f", w);          /* { dg-warning "writing between 1 and (2147483648|32768) bytes" } */
+  T1 ("%*.1f", w);          /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
+  T1 ("%*.2f", w);          /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
 
-  T1 ("%.*f",  p);          /* { dg-warning "writing between 1 and 2147483958 bytes" } */
-  T1 ("%1.*f", p);          /* { dg-warning "writing between 1 and 2147483958 bytes" } */
-  T1 ("%2.*f", p);          /* { dg-warning "writing between 2 and 2147483958 bytes" } */
-  T1 ("%3.*f", p);          /* { dg-warning "writing between 3 and 2147483958 bytes" } */
+  T1 ("%.*f",  p);          /* { dg-warning "writing between 1 and (2147483958|33078) bytes" } */
+  T1 ("%1.*f", p);          /* { dg-warning "writing between 1 and (2147483958|33078) bytes" } */
+  T1 ("%2.*f", p);          /* { dg-warning "writing between 2 and (2147483958|33078) bytes" } */
+  T1 ("%3.*f", p);          /* { dg-warning "writing between 3 and (2147483958|33078) bytes" } */
 
-  T2 ("%*.*f", w, p);       /* { dg-warning "writing between 1 and 2147483958 bytes" } */
+  T2 ("%*.*f", w, p);       /* { dg-warning "writing between 1 and (2147483958|33078) bytes" } */
 }
 
 /* Exercise %g.  The expected output is the lesser of %e and %f.  */
@@ -152,18 +152,18 @@ void test_a_va (va_list va)
   T ("%6.a");       /* { dg-warning "between 6 and 10 bytes" } */
   T ("%7.a");       /* { dg-warning "between 7 and 10 bytes" } */
 
-  T ("%*.a");       /* { dg-warning "writing between 3 and 2147483648 bytes" } */
-  T ("%*.0a");      /* { dg-warning "writing between 3 and 2147483648 bytes" } */
-  T ("%*.1a");      /* { dg-warning "writing between 3 and 2147483648 bytes" } */
-  T ("%*.2a");      /* { dg-warning "writing between 3 and 2147483648 bytes" } */
+  T ("%*.a");       /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
+  T ("%*.0a");      /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
+  T ("%*.1a");      /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
+  T ("%*.2a");      /* { dg-warning "writing between 3 and (2147483648|32768) bytes" } */
 
-  T ("%.*a");       /* { dg-warning "writing between 3 and 2147483658 bytes" } */
-  T ("%1.*a");      /* { dg-warning "writing between 3 and 2147483658 bytes" } */
-  T ("%2.*a");      /* { dg-warning "writing between 3 and 2147483658 bytes" } */
-  T ("%6.*a");      /* { dg-warning "writing between 6 and 2147483658 bytes" } */
-  T ("%9.*a");      /* { dg-warning "writing between 9 and 2147483658 bytes" } */
+  T ("%.*a");       /* { dg-warning "writing between 3 and (2147483658|32778) bytes" } */
+  T ("%1.*a");      /* { dg-warning "writing between 3 and (2147483658|32778) bytes" } */
+  T ("%2.*a");      /* { dg-warning "writing between 3 and (2147483658|32778) bytes" } */
+  T ("%6.*a");      /* { dg-warning "writing between 6 and (2147483658|32778) bytes" } */
+  T ("%9.*a");      /* { dg-warning "writing between 9 and (2147483658|32778) bytes" } */
 
-  T ("%*.*a");      /* { dg-warning "writing between 3 and 2147483658 bytes" } */
+  T ("%*.*a");      /* { dg-warning "writing between 3 and (2147483658|32778) bytes" } */
 }
 
 /* Exercise %e.  */
@@ -191,12 +191,12 @@ void test_e_va (va_list va)
   T ("%6.e");       /* { dg-warning "between 6 and 7 bytes" } */
   T ("%7.e");       /* { dg-warning "writing 7 bytes" } */
 
-  T ("%.*e");       /* { dg-warning "writing between 3 and 2147483655 bytes" } */
-  T ("%1.*e");      /* { dg-warning "writing between 3 and 2147483655 bytes" } */
-  T ("%6.*e");      /* { dg-warning "writing between 6 and 2147483655 bytes" } */
-  T ("%9.*e");      /* { dg-warning "writing between 9 and 2147483655 bytes" } */
+  T ("%.*e");       /* { dg-warning "writing between 3 and (2147483655|32775) bytes" } */
+  T ("%1.*e");      /* { dg-warning "writing between 3 and (2147483655|32775) bytes" } */
+  T ("%6.*e");      /* { dg-warning "writing between 6 and (2147483655|32775) bytes" } */
+  T ("%9.*e");      /* { dg-warning "writing between 9 and (2147483655|32775) bytes" } */
 
-  T ("%*.*e");      /* { dg-warning "writing between 3 and 2147483655 bytes" } */
+  T ("%*.*e");      /* { dg-warning "writing between 3 and (2147483655|32775) bytes" } */
 }
 
 /* Exercise %f.  */
@@ -228,11 +228,11 @@ void test_f_va (va_list va)
   T ("%312.312f");  /* { dg-warning "between 312 and 623 bytes" } */
   T ("%312.313f");  /* { dg-warning "between 312 and 624 bytes" } */
 
-  T ("%.*f");       /* { dg-warning "writing between 1 and 2147483958 bytes" } */
-  T ("%1.*f");      /* { dg-warning "writing between 1 and 2147483958 bytes" } */
-  T ("%3.*f");      /* { dg-warning "writing between 3 and 2147483958 bytes" } */
+  T ("%.*f");       /* { dg-warning "writing between 1 and (2147483958|33078) bytes" } */
+  T ("%1.*f");      /* { dg-warning "writing between 1 and (2147483958|33078) bytes" } */
+  T ("%3.*f");      /* { dg-warning "writing between 3 and (2147483958|33078) bytes" } */
 
-  T ("%*.*f");      /* { dg-warning "writing between 1 and 2147483958 bytes" } */
+  T ("%*.*f");      /* { dg-warning "writing between 1 and (2147483958|33078) bytes" } */
 }
 
 /* Exercise %g.  The expected output is the lesser of %e and %f.  */
@@ -270,5 +270,5 @@ void test_g_va (va_list va)
   T ("%1.*g");      /* { dg-warning "writing between 1 and 310 bytes" } */
   T ("%4.*g");      /* { dg-warning "writing between 4 and 310 bytes" } */
 
-  T ("%*.*g");      /* { dg-warning "writing between 1 and 2147483648 bytes" } */
+  T ("%*.*g");      /* { dg-warning "writing between 1 and (2147483648|32768) bytes" } */
 }
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr79327-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr79327-2.c
index 4c9d606..9b392f3 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr79327-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr79327-2.c
@@ -76,6 +76,7 @@ int test_o_var (int i)
   ASSERT_MAYBE (5 == n);
   ASSERT_MAYBE (6 == n);
   ASSERT_MAYBE (7 == n);
+  /* Below will be optimized out for 16-bit int.  */
   ASSERT_MAYBE (8 == n);
   ASSERT_MAYBE (9 == n);
   ASSERT_MAYBE (10 == n);
@@ -147,6 +148,7 @@ int test_x_var (int i)
   ASSERT_MAYBE (4 == n);
   ASSERT_MAYBE (5 == n);
   ASSERT_MAYBE (6 == n);
+  /* Below will be optimized out for 16-bit int.  */
   ASSERT_MAYBE (7 == n);
   ASSERT_MAYBE (8 == n);
   ASSERT_MAYBE (9 == n);
@@ -156,4 +158,5 @@ int test_x_var (int i)
 }
 
 /* { dg-final { scan-tree-dump-not "failure_on_line" "optimized"} }
-   { dg-final { scan-tree-dump-times "keep_call_on_line" 43 "optimized"} } */
+   { dg-final { scan-tree-dump-times "keep_call_on_line" 43 "optimized" { target { ! int16 } } } }
+   { dg-final { scan-tree-dump-times "keep_call_on_line" 34 "optimized" { target int16 } } } */
-- 
2.7.4


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 5/7][MSP430][TESTSUITE] Prune messages about ISO C not supporting __int20 from output of tests
  2018-11-14 15:41 [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf Jozef Lawrynowicz
                   ` (3 preceding siblings ...)
  2018-11-14 15:52 ` [PATCH 4/7][MSP430][TESTSUITE] Fix tests when int is 16-bit by default Jozef Lawrynowicz
@ 2018-11-14 15:56 ` Jozef Lawrynowicz
  2018-11-26 20:51   ` Mike Stump
  2018-11-14 15:58 ` [PATCH 6/7][MSP430][TESTSUITE] Fix tests requiring float printf support when GCC was configured with --enable-newlib-nano-formatted-io Jozef Lawrynowicz
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-14 15:56 UTC (permalink / raw)
  To: GCC Patches; +Cc: Nick Clifton

[-- Attachment #1: Type: text/plain, Size: 880 bytes --]

Patch 5 deals with ISO C errors emitted by tests when the large memory model is
used. size_t and ptrdiff_t are __int20 with -mlarge, and if the test is
compiled with -pedantic-errors and -std=* or -ansi, then use of these types
causes an error of the form:
   ISO C does not support __int20 types
I fixed this by adding dg-prune-output directives to tests which cause this
error.

Alternatively, I considered adding typedefs preceded by  __extension__ to fix
these errors, but in many cases __SIZE_TYPE__ is directly used so replacing all
these with a new typedef'd type changes the code in more places, in some cases
changing the offset for dg-warning or dg-error directives. Changing the line
numbers for dg-warning/dg-error adds further manual steps to comparing
testresults and as these are generic tests I wanted to minimize the effect on
the testresults for other targets.


[-- Attachment #2: 0005-TESTSUITE-Prune-messages-about-ISO-C-not-supporting-.patch --]
[-- Type: text/x-patch, Size: 9582 bytes --]

From ed24754b1d97992400bb374916d87cce151f7e89 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Sat, 10 Nov 2018 15:47:21 +0000
Subject: [PATCH 5/7] [TESTSUITE] Prune messages about ISO C not supporting
 __int20 from output of tests

2018-11-14  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/testsuite/ChangeLog:

	* gcc.dg/addr_builtin-1.c: Prune ISO C does not support __int20
	message from output.
	* gcc.dg/c11-static-assert-3.c: Likewise.
	* gcc.dg/c11-uni-string-1.c: Likewise.
	* gcc.dg/c99-const-expr-10.c: Likewise.
	* gcc.dg/c99-const-expr-6.c: Likewise.
	* gcc.dg/c99-const-expr-9.c: Likewise.
	* gcc.dg/c99-init-1.c: Likewise.
	* gcc.dg/c99-stdint-5.c: Likewise.
	* gcc.dg/c99-stdint-6.c: Likewise.
	* gcc.dg/pr52549.c: Likewise.
	* gcc.dg/pr61240.c: Likewise.
	* gcc.dg/pr71558.c: Likewise.
	* gcc.dg/pr77587.c: Likewise.
	* gcc.dg/pr79223.c: Likewise.
	* gcc.dg/vla-11.c: Likewise.
	* gcc.dg/vla-9.c: Likewise.

---
 gcc/testsuite/gcc.dg/addr_builtin-1.c      | 3 ++-
 gcc/testsuite/gcc.dg/c11-static-assert-3.c | 1 +
 gcc/testsuite/gcc.dg/c11-uni-string-1.c    | 1 +
 gcc/testsuite/gcc.dg/c99-const-expr-10.c   | 1 +
 gcc/testsuite/gcc.dg/c99-const-expr-6.c    | 1 +
 gcc/testsuite/gcc.dg/c99-const-expr-9.c    | 1 +
 gcc/testsuite/gcc.dg/c99-init-1.c          | 1 +
 gcc/testsuite/gcc.dg/c99-stdint-5.c        | 1 +
 gcc/testsuite/gcc.dg/c99-stdint-6.c        | 1 +
 gcc/testsuite/gcc.dg/pr52549.c             | 1 +
 gcc/testsuite/gcc.dg/pr61240.c             | 1 +
 gcc/testsuite/gcc.dg/pr71558.c             | 1 +
 gcc/testsuite/gcc.dg/pr77587.c             | 1 +
 gcc/testsuite/gcc.dg/pr79223.c             | 3 ++-
 gcc/testsuite/gcc.dg/vla-11.c              | 1 +
 gcc/testsuite/gcc.dg/vla-9.c               | 1 +
 16 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/addr_builtin-1.c b/gcc/testsuite/gcc.dg/addr_builtin-1.c
index 4a0888a..7d91c62 100644
--- a/gcc/testsuite/gcc.dg/addr_builtin-1.c
+++ b/gcc/testsuite/gcc.dg/addr_builtin-1.c
@@ -1,5 +1,6 @@
 /* PR66516 - missing diagnostic on taking the address of a builtin function
-   { dg-do compile }  */
+   { dg-do compile }
+   { dg-prune-output "ISO C does not support.*__int20" }  */
 
 typedef void (F)(void);
 typedef __UINTPTR_TYPE__ uintptr_t;
diff --git a/gcc/testsuite/gcc.dg/c11-static-assert-3.c b/gcc/testsuite/gcc.dg/c11-static-assert-3.c
index 9799b97..ea369e9 100644
--- a/gcc/testsuite/gcc.dg/c11-static-assert-3.c
+++ b/gcc/testsuite/gcc.dg/c11-static-assert-3.c
@@ -1,6 +1,7 @@
 /* Test C11 static assertions.  Invalid assertions.  */
 /* { dg-do compile } */
 /* { dg-options "-std=c11 -pedantic-errors" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 _Static_assert (__INT_MAX__ * 2, "overflow"); /* { dg-warning "integer overflow in expression" } */
 /* { dg-error "overflow in constant expression" "error" { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/c11-uni-string-1.c b/gcc/testsuite/gcc.dg/c11-uni-string-1.c
index 9f86bea..9b47f6a6 100644
--- a/gcc/testsuite/gcc.dg/c11-uni-string-1.c
+++ b/gcc/testsuite/gcc.dg/c11-uni-string-1.c
@@ -1,6 +1,7 @@
 /* Test Unicode strings in C11.  Test valid code.  */
 /* { dg-do run } */
 /* { dg-options "-std=c11 -pedantic-errors" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 /* More thorough tests are in c-c++-common/raw-string-*.c; this test
    verifies the particular subset (Unicode but not raw strings) that
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-10.c b/gcc/testsuite/gcc.dg/c99-const-expr-10.c
index 2aca610..bb5af01 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-10.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-10.c
@@ -4,6 +4,7 @@
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 void *p = (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
 struct s { void *a; } q = { (__SIZE_TYPE__)(void *)0 }; /* { dg-error "without a cast|near initialization" } */
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-6.c b/gcc/testsuite/gcc.dg/c99-const-expr-6.c
index ca60243..b985ade 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-6.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-6.c
@@ -3,6 +3,7 @@
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 /* PR 29116.  */
 int n = 0, p[n * 0 + 1]; /* { dg-error "variabl" } */
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-9.c b/gcc/testsuite/gcc.dg/c99-const-expr-9.c
index 11e0b2c..eaacfa7 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-9.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-9.c
@@ -4,6 +4,7 @@
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors -ftrack-macro-expansion=0" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 struct s {
   int a;
diff --git a/gcc/testsuite/gcc.dg/c99-init-1.c b/gcc/testsuite/gcc.dg/c99-init-1.c
index 95803c2..6a7300e 100644
--- a/gcc/testsuite/gcc.dg/c99-init-1.c
+++ b/gcc/testsuite/gcc.dg/c99-init-1.c
@@ -2,6 +2,7 @@
 /* Origin: Jakub Jelinek <jakub@redhat.com> */
 /* { dg-do run } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 typedef __SIZE_TYPE__ size_t;
 typedef __WCHAR_TYPE__ wchar_t;
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-5.c b/gcc/testsuite/gcc.dg/c99-stdint-5.c
index 6051323..3946f79 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-5.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-5.c
@@ -4,6 +4,7 @@
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
 /* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 #include <stdint.h>
 #ifndef SIGNAL_SUPPRESS
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-6.c b/gcc/testsuite/gcc.dg/c99-stdint-6.c
index 60ac31f..554f47a 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-6.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-6.c
@@ -3,6 +3,7 @@
 /* { dg-do compile { target inttypes_types } } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
 /* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 #include <inttypes.h>
 #ifndef SIGNAL_SUPPRESS
diff --git a/gcc/testsuite/gcc.dg/pr52549.c b/gcc/testsuite/gcc.dg/pr52549.c
index 4d0a3e0..bb81d5c 100644
--- a/gcc/testsuite/gcc.dg/pr52549.c
+++ b/gcc/testsuite/gcc.dg/pr52549.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 #ifdef __SIZE_TYPE__
 _mark (__SIZE_TYPE__ obj, int i, char *a)
diff --git a/gcc/testsuite/gcc.dg/pr61240.c b/gcc/testsuite/gcc.dg/pr61240.c
index 6332918..af7c3f6 100644
--- a/gcc/testsuite/gcc.dg/pr61240.c
+++ b/gcc/testsuite/gcc.dg/pr61240.c
@@ -1,5 +1,6 @@
 /* PR c/61240 */
 /* { dg-do compile } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 
diff --git a/gcc/testsuite/gcc.dg/pr71558.c b/gcc/testsuite/gcc.dg/pr71558.c
index 33a648e..6c97f3a 100644
--- a/gcc/testsuite/gcc.dg/pr71558.c
+++ b/gcc/testsuite/gcc.dg/pr71558.c
@@ -1,4 +1,5 @@
 /* PR tree-optimization/71588 */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 /* strcpy must not be pure, but make sure we don't ICE even when
    it is declared incorrectly.  */
diff --git a/gcc/testsuite/gcc.dg/pr77587.c b/gcc/testsuite/gcc.dg/pr77587.c
index 8f5afef..3028d07 100644
--- a/gcc/testsuite/gcc.dg/pr77587.c
+++ b/gcc/testsuite/gcc.dg/pr77587.c
@@ -3,6 +3,7 @@
 /* { dg-require-alias "" } */
 /* { dg-require-weak-override "" } */
 /* { dg-additional-sources "pr77587a.c" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 void
 bar (long x, long y, long z)
diff --git a/gcc/testsuite/gcc.dg/pr79223.c b/gcc/testsuite/gcc.dg/pr79223.c
index ef0dd1b..24c5f52 100644
--- a/gcc/testsuite/gcc.dg/pr79223.c
+++ b/gcc/testsuite/gcc.dg/pr79223.c
@@ -1,6 +1,7 @@
 /* PR middle-end/79223 - missing -Wstringop-overflow on a memmove overflow
    { dg-do compile }
-   { dg-additional-options "-O2 -Wall -Wno-array-bounds -std=gnu99" }  */
+   { dg-additional-options "-O2 -Wall -Wno-array-bounds -std=gnu99" }
+   { dg-prune-output "ISO C does not support.*__int20" }  */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/vla-11.c b/gcc/testsuite/gcc.dg/vla-11.c
index 1504853..f52d65d 100644
--- a/gcc/testsuite/gcc.dg/vla-11.c
+++ b/gcc/testsuite/gcc.dg/vla-11.c
@@ -5,6 +5,7 @@
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
 /* { dg-options "-std=c99 -pedantic-errors" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 
 void foo11a(int x[sizeof(int *(*)[*])]);	/* { dg-warning "not in a declaration" } */
 void foo11b(__SIZE_TYPE__ x, int y[(__UINTPTR_TYPE__)(int (*)[*])x]);	/* { dg-warning "not in a declaration" } */
diff --git a/gcc/testsuite/gcc.dg/vla-9.c b/gcc/testsuite/gcc.dg/vla-9.c
index 506a1a2..e6506d7 100644
--- a/gcc/testsuite/gcc.dg/vla-9.c
+++ b/gcc/testsuite/gcc.dg/vla-9.c
@@ -1,5 +1,6 @@
 /* { dg-do compile  } */
 /* { dg-options "-std=c99 -pedantic-errors -W -Wall" } */
+/* { dg-prune-output "ISO C does not support.*__int20" } */
 /* PR c/28280 */
 
 void f(__SIZE_TYPE__ d)
-- 
2.7.4


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 6/7][MSP430][TESTSUITE] Fix tests requiring float printf support when GCC was configured with --enable-newlib-nano-formatted-io
  2018-11-14 15:41 [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf Jozef Lawrynowicz
                   ` (4 preceding siblings ...)
  2018-11-14 15:56 ` [PATCH 5/7][MSP430][TESTSUITE] Prune messages about ISO C not supporting __int20 from output of tests Jozef Lawrynowicz
@ 2018-11-14 15:58 ` Jozef Lawrynowicz
  2018-11-26 20:26   ` Mike Stump
  2018-11-14 15:59 ` [PATCH 7/7][MSP430][TESTSUITE] Fix tests for msp430-elf large memory model Jozef Lawrynowicz
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-14 15:58 UTC (permalink / raw)
  To: GCC Patches; +Cc: Nick Clifton

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

Patch 6 fixes tests expecting printf float support for targets which have been
configured with "newlib-nano-formatted-io". When newlib is configured in this
way, float printf is enabled at build time by registering _printf_float as an
undefined symbol.


[-- Attachment #2: 0006-TESTSUITE-Fix-tests-requiring-float-printf-support-w.patch --]
[-- Type: text/x-patch, Size: 3280 bytes --]

From 15a04e0139ec40196ddb79f1125635029dccae68 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Sat, 10 Nov 2018 16:02:25 +0000
Subject: [PATCH 6/7] [TESTSUITE] Fix tests requiring float printf support when
 GCC was configured with --enable-newlib-nano-formatted-io

2018-11-14  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/testsuite/ChangeLog:

	* lib/target-supports.exp (check_effective_target_newlib_nano_io): New. 
	* gcc.c-torture/execute/920501-8.c: Register undefined linker symbol
	_printf_float for newlib_nano_io target.
	* gcc.c-torture/execute/930513-1.c: Likewise.
	* gcc.dg/torture/builtin-sprintf.c: Likewise.
	* gcc.c-torture/execute/ieee/920810-1.x: New.
---
 gcc/testsuite/gcc.c-torture/execute/920501-8.c      | 2 ++
 gcc/testsuite/gcc.c-torture/execute/930513-1.c      | 2 ++
 gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x | 4 ++++
 gcc/testsuite/gcc.dg/torture/builtin-sprintf.c      | 3 ++-
 gcc/testsuite/lib/target-supports.exp               | 4 ++++
 5 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x

diff --git a/gcc/testsuite/gcc.c-torture/execute/920501-8.c b/gcc/testsuite/gcc.c-torture/execute/920501-8.c
index 62780a0..7e4fa17 100644
--- a/gcc/testsuite/gcc.c-torture/execute/920501-8.c
+++ b/gcc/testsuite/gcc.c-torture/execute/920501-8.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-Wl,-u,_printf_float" { target newlib_nano_io } } */
+
 #include <stdio.h>
 #include <stdarg.h>
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/930513-1.c b/gcc/testsuite/gcc.c-torture/execute/930513-1.c
index 4544471..f163007 100644
--- a/gcc/testsuite/gcc.c-torture/execute/930513-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/930513-1.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-Wl,-u,_printf_float" { target newlib_nano_io } } */
+
 #include <stdio.h>
 char buf[2];
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x
new file mode 100644
index 0000000..8edec730
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x
@@ -0,0 +1,4 @@
+if { [check_effective_target_newlib_nano_io] } {
+    lappend additional_flags "-Wl,-u,_printf_float"
+}
+return 0
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-sprintf.c b/gcc/testsuite/gcc.dg/torture/builtin-sprintf.c
index 6f8b7a9..5684fd7 100644
--- a/gcc/testsuite/gcc.dg/torture/builtin-sprintf.c
+++ b/gcc/testsuite/gcc.dg/torture/builtin-sprintf.c
@@ -1,6 +1,7 @@
 /* PR tree-optimization/86274 - SEGFAULT when logging std::to_string(NAN)
    { dg-do run }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall" }
+   { dg-additional-options "-Wl,-u,_printf_float" { target newlib_nano_io } } */
 
 #define X        "0xdeadbeef"
 #define nan(x)   __builtin_nan (x)
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 5235d5e..ced1582 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -8946,3 +8946,7 @@ proc check_effective_target_cet { } {
 	}
     } "-O2" ]
 }
+
+proc check_effective_target_newlib_nano_io { } {
+    return [check_configured_with "--enable-newlib-nano-formatted-io"]
+}
-- 
2.7.4


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 7/7][MSP430][TESTSUITE] Fix tests for msp430-elf large memory model
  2018-11-14 15:41 [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf Jozef Lawrynowicz
                   ` (5 preceding siblings ...)
  2018-11-14 15:58 ` [PATCH 6/7][MSP430][TESTSUITE] Fix tests requiring float printf support when GCC was configured with --enable-newlib-nano-formatted-io Jozef Lawrynowicz
@ 2018-11-14 15:59 ` Jozef Lawrynowicz
  2018-11-21 19:05 ` [PATCH 1/7][v2][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf Jozef Lawrynowicz
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-14 15:59 UTC (permalink / raw)
  To: GCC Patches; +Cc: Nick Clifton

[-- Attachment #1: Type: text/plain, Size: 63 bytes --]

Patch 7 fixes tests for msp430-elf in the large memory model.


[-- Attachment #2: 0007-TESTSUITE-Fix-tests-for-msp430-elf-large-memory-mode.patch --]
[-- Type: text/x-patch, Size: 16981 bytes --]

From 494465f13df814bf3daad5e330d2c7139f2db625 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Sat, 10 Nov 2018 16:08:44 +0000
Subject: [PATCH 7/7] [TESTSUITE] Fix tests for msp430-elf large memory model

2018-11-14  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/testsuite/ChangeLog:

	* gcc.c-torture/execute/991014-1.c: Fix bufsize definition for
	msp430 large memory model.
	* gcc.dg/Walloca-1.c: Don't expect warning for msp430 large memory
	model.
	* gcc.dg/Walloca-2.c: Likewise.
	* gcc.dg/c99-const-expr-2.c: Define ZERO macro for msp430 large memory
	model.
	* gcc.dg/format/format.h: Prefix typedefs using __SIZE_TYPE__ and
	__PTRDIFF_TYPE__ with __extension__.
	* gcc.dg/lto/20081210-1_0.c: Always typedef uintptr_t as
	__UINTPTR_TYPE__.
	* gcc.dg/pr36227.c: Likewise.
	* gcc.dg/pr42611.c: Use __INTPTR_MAX__ as the maximum object size if
	size_t and ptr_t are the same size.
	* gcc.dg/pr78973.c: dg-warning XFAIL for int16 but not msp430 large
	memory model.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Update dg-warning
	directives for msp430 large memory model.
	* gcc.dg/tree-ssa/pr66449.c: Always use __INTPTR_TYPE__ when integer
	type equal in size to ptr_t is required.
	* gcc.dg/tree-ssa/ssa-dom-thread-8.c: Extend pointer size checking
	macro for msp430.
	* lib/target-supports.exp (check_effective_target_msp430_large_mem):
	New. 

---
 gcc/testsuite/gcc.c-torture/execute/991014-1.c     |  7 ++++-
 gcc/testsuite/gcc.dg/Walloca-1.c                   |  4 +--
 gcc/testsuite/gcc.dg/Walloca-2.c                   |  8 +++---
 gcc/testsuite/gcc.dg/c99-const-expr-2.c            |  2 ++
 gcc/testsuite/gcc.dg/format/format.h               |  6 ++--
 gcc/testsuite/gcc.dg/lto/20081210-1_0.c            |  8 +-----
 gcc/testsuite/gcc.dg/pr36227.c                     | 10 +------
 gcc/testsuite/gcc.dg/pr42611.c                     |  3 +-
 gcc/testsuite/gcc.dg/pr78973.c                     |  2 +-
 .../gcc.dg/tree-ssa/builtin-sprintf-warn-3.c       | 32 +++++++++++-----------
 gcc/testsuite/gcc.dg/tree-ssa/pr66449.c            |  8 ++----
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c   |  8 +++---
 gcc/testsuite/lib/target-supports.exp              |  7 +++++
 13 files changed, 52 insertions(+), 53 deletions(-)

diff --git a/gcc/testsuite/gcc.c-torture/execute/991014-1.c b/gcc/testsuite/gcc.c-torture/execute/991014-1.c
index e0bcd6d..95e38ce 100644
--- a/gcc/testsuite/gcc.c-torture/execute/991014-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/991014-1.c
@@ -1,11 +1,16 @@
-
 typedef __SIZE_TYPE__ Size_t;
 
+#ifdef __MSP430X_LARGE__
+/* size_t is __int20, so 20 bits, for __MSP430X_LARGE__, but __SIZEOF_POINTER__
+   returns the bytesize which is 4.  */
+#define bufsize ((1L << (20 - 2))-256)
+#else  /* !__MSP430X_LARGE__ */
 #if __SIZEOF_LONG__ < __SIZEOF_POINTER__
 #define bufsize ((1LL << (8 * sizeof(Size_t) - 2))-256)
 #else
 #define bufsize ((1L << (8 * sizeof(Size_t) - 2))-256)
 #endif
+#endif
 
 struct huge_struct
 {
diff --git a/gcc/testsuite/gcc.dg/Walloca-1.c b/gcc/testsuite/gcc.dg/Walloca-1.c
index 85e9160..c9a6c57 100644
--- a/gcc/testsuite/gcc.dg/Walloca-1.c
+++ b/gcc/testsuite/gcc.dg/Walloca-1.c
@@ -24,8 +24,8 @@ void foo1 (size_t len, size_t len2, size_t len3)
   char *s = alloca (123);
   useit (s);			// OK, constant argument to alloca
 
-  s = alloca (num);		// { dg-warning "large due to conversion" "" { target lp64 } }
-  // { dg-warning "unbounded use of 'alloca'" "" { target { ! lp64 } } .-1 }
+  s = alloca (num);		// { dg-warning "large due to conversion" "" { target { { lp64 } || { msp430_large_mem } } } }
+  // { dg-warning "unbounded use of 'alloca'" "" { target { { ! lp64 } && { ! msp430_large_mem } } } .-1 }
   useit (s);
 
   s = alloca (30000);		/* { dg-warning "is too large" } */
diff --git a/gcc/testsuite/gcc.dg/Walloca-2.c b/gcc/testsuite/gcc.dg/Walloca-2.c
index 766ff8d..446c811 100644
--- a/gcc/testsuite/gcc.dg/Walloca-2.c
+++ b/gcc/testsuite/gcc.dg/Walloca-2.c
@@ -13,7 +13,7 @@ g1 (int n)
     // 32-bit targets because VRP is not giving us any range info for
     // the argument to __builtin_alloca.  This should be fixed by the
     // upcoming range work.
-    p = __builtin_alloca (n); // { dg-bogus "unbounded use of 'alloca'" "" { xfail { ! lp64 } } }
+    p = __builtin_alloca (n); // { dg-bogus "unbounded use of 'alloca'" "" { xfail { { ! lp64 } && { ! msp430_large_mem } } } }
   else
     p = __builtin_malloc (n);
   f (p);
@@ -36,9 +36,9 @@ g3 (int n)
   void *p;
   if (n > 0 && n < 3000)
     {
-      p = __builtin_alloca (n); // { dg-warning "'alloca' may be too large" "" { target lp64} }
-      // { dg-message "note:.*argument may be as large as 2999" "note" { target lp64 } .-1 }
-      // { dg-warning "unbounded use of 'alloca'" "" { target { ! lp64 } } .-2 }
+      p = __builtin_alloca (n); // { dg-warning "'alloca' may be too large" "" { target { lp64 || msp430_large_mem } } }
+      // { dg-message "note:.*argument may be as large as 2999" "note" { target { lp64 || msp430_large_mem } } .-1 }
+      // { dg-warning "unbounded use of 'alloca'" "" { target { { ! lp64 } && { ! msp430_large_mem } } } .-2 }
     }
   else
     p = __builtin_malloc (n);
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-2.c b/gcc/testsuite/gcc.dg/c99-const-expr-2.c
index a78e412..2b85706 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-2.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-2.c
@@ -18,6 +18,8 @@ long *c;
 #define ZERO 0L
 #elif defined(_WIN64)
 #define ZERO 0LL
+#elif defined(__MSP430X_LARGE__)
+#define ZERO (__int20)0
 #else
 #define ZERO 0
 #endif
diff --git a/gcc/testsuite/gcc.dg/format/format.h b/gcc/testsuite/gcc.dg/format/format.h
index a99927e..2d0a71b 100644
--- a/gcc/testsuite/gcc.dg/format/format.h
+++ b/gcc/testsuite/gcc.dg/format/format.h
@@ -58,12 +58,12 @@ __extension__ typedef unsigned int ullong  __attribute__ ((mode (DI)));
 #else
 /* Kludges to get types corresponding to size_t and ptrdiff_t.  */
 #define unsigned signed
-typedef __SIZE_TYPE__ signed_size_t;
+__extension__ typedef __SIZE_TYPE__ signed_size_t;
 /* We also use this type to approximate ssize_t.  */
-typedef __SIZE_TYPE__ ssize_t;
+__extension__ typedef __SIZE_TYPE__ ssize_t;
 #undef unsigned
 #define signed /* Type might or might not have explicit 'signed'.  */
-typedef unsigned __PTRDIFF_TYPE__ unsigned_ptrdiff_t;
+__extension__ typedef unsigned __PTRDIFF_TYPE__ unsigned_ptrdiff_t;
 #undef signed
 
 __extension__ typedef long long int llong;
diff --git a/gcc/testsuite/gcc.dg/lto/20081210-1_0.c b/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
index 80a1e9a..8048b26 100644
--- a/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
+++ b/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
@@ -1,10 +1,4 @@
-#if defined(_LP64)
-typedef unsigned long int uintptr_t;
-#elif defined (_WIN64)
-typedef unsigned long long int uintptr_t;
-#else
-typedef unsigned int uintptr_t;
-#endif
+typedef __UINTPTR_TYPE__ uintptr_t;
 
 extern void srand (uintptr_t);
 
diff --git a/gcc/testsuite/gcc.dg/pr36227.c b/gcc/testsuite/gcc.dg/pr36227.c
index 27fe001..ba0d722 100644
--- a/gcc/testsuite/gcc.dg/pr36227.c
+++ b/gcc/testsuite/gcc.dg/pr36227.c
@@ -1,14 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -Wstrict-overflow=3" } */
-#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__)
-typedef unsigned long long ptrcast;
-#elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__)
-typedef unsigned long ptrcast;
-#elif (__SIZEOF_INT__ == __SIZEOF_POINTER__)
-typedef unsigned int ptrcast;
-#else
-#error Add target support here
-#endif
+typedef __UINTPTR_TYPE__ ptrcast;
 
 volatile unsigned long *
 sat_add(volatile unsigned long *ptr, unsigned long i, volatile unsigned long *end)
diff --git a/gcc/testsuite/gcc.dg/pr42611.c b/gcc/testsuite/gcc.dg/pr42611.c
index 0426ce2..f502fea 100644
--- a/gcc/testsuite/gcc.dg/pr42611.c
+++ b/gcc/testsuite/gcc.dg/pr42611.c
@@ -3,7 +3,8 @@
 /* { dg-options "" } */
 
 #define L \
-  (sizeof (__SIZE_TYPE__) == 1 ? __SCHAR_MAX__				\
+  (sizeof (__SIZE_TYPE__) == sizeof (void *) ? __INTPTR_MAX__ \
+  : sizeof (__SIZE_TYPE__) == 1 ? __SCHAR_MAX__				\
   : sizeof (__SIZE_TYPE__) == sizeof (short) ? __SHRT_MAX__		\
   : sizeof (__SIZE_TYPE__) == sizeof (int) ? __INT_MAX__		\
   : sizeof (__SIZE_TYPE__) == sizeof (long) ? __LONG_MAX__		\
diff --git a/gcc/testsuite/gcc.dg/pr78973.c b/gcc/testsuite/gcc.dg/pr78973.c
index 6c53f89..e0148bbc 100644
--- a/gcc/testsuite/gcc.dg/pr78973.c
+++ b/gcc/testsuite/gcc.dg/pr78973.c
@@ -9,7 +9,7 @@
 void f (void *p, int n)
 {
   if (n <= 4)
-    __builtin_memset (p, 0, n);   /* { dg-warning "exceeds maximum object size" "pr79073" { xfail ilp32 } } */
+    __builtin_memset (p, 0, n);   /* { dg-warning "exceeds maximum object size" "pr79073" { xfail { ilp32 || { int16 && { ! msp430_large_mem } } } } } */
 }
 
 void g (void *d, unsigned n)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c
index d06248b..30a44a1 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c
@@ -357,35 +357,35 @@ void test_too_large (char *d, int x, __builtin_va_list va)
   const size_t imax_p1 = imax + 1;
 
   __builtin_snprintf (d, imax,    "%c", x);
-  __builtin_snprintf (d, imax_p1, "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */
-  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */
+  __builtin_snprintf (d, imax_p1, "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large_mem } } } */
+  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { ilp32 } || { int16 && { ! msp430_large_mem } } } } .-1 } */
 
   __builtin_vsnprintf (d, imax,    "%c", va);
-  __builtin_vsnprintf (d, imax_p1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */
-  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */
+  __builtin_vsnprintf (d, imax_p1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large_mem } } } */
+  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { ilp32 } || { int16 && { ! msp430_large_mem } } } } .-1 } */
 
   __builtin___snprintf_chk (d, imax,    0, imax,    "%c", x);
-  __builtin___snprintf_chk (d, imax_p1, 0, imax_p1, "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */
-  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */
+  __builtin___snprintf_chk (d, imax_p1, 0, imax_p1, "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large_mem } } } */
+  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { ilp32 } || { int16 && { ! msp430_large_mem } } } } .-1 } */
 
   __builtin___vsnprintf_chk (d, imax,    0, imax,    "%c", va);
-  __builtin___vsnprintf_chk (d, imax_p1, 0, imax_p1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */
-  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */
+  __builtin___vsnprintf_chk (d, imax_p1, 0, imax_p1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large_mem } } } */
+  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { ilp32 } || { int16 && { ! msp430_large_mem } } } } .-1 } */
 
   const size_t ptrmax = __PTRDIFF_MAX__;
   const size_t ptrmax_m1 = ptrmax - 1;
 
-  __builtin_snprintf (d, ptrmax_m1, "%c", x);  /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */
-  __builtin_snprintf (d, ptrmax, "  %c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */
+  __builtin_snprintf (d, ptrmax_m1, "%c", x);  /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large_mem } } } */
+  __builtin_snprintf (d, ptrmax, "  %c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large_mem } } } */
 
-  __builtin_vsnprintf (d, ptrmax_m1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */
-  __builtin_vsnprintf (d, ptrmax,    "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */
+  __builtin_vsnprintf (d, ptrmax_m1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large_mem } } } */
+  __builtin_vsnprintf (d, ptrmax,    "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large_mem } } } */
 
-  __builtin___snprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */
-  __builtin___snprintf_chk (d, ptrmax,    0, ptrmax,    "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */
+  __builtin___snprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large_mem } } } */
+  __builtin___snprintf_chk (d, ptrmax,    0, ptrmax,    "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large_mem } } } */
 
-  __builtin___vsnprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */
-  __builtin___vsnprintf_chk (d, ptrmax,    0, ptrmax,    "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */
+  __builtin___vsnprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large_mem } } } */
+  __builtin___vsnprintf_chk (d, ptrmax,    0, ptrmax,    "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large_mem } } } */
 }
 
 /* Exercise ordinary sprintf with malloc.  */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr66449.c b/gcc/testsuite/gcc.dg/tree-ssa/pr66449.c
index cce26eb..3b6de12 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr66449.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr66449.c
@@ -1,13 +1,11 @@
 /* { dg-do compile } */
 /* { dg-options "-O3" } */
 
-#if __SIZEOF_POINTER__ != __SIZEOF_LONG__
-#define long __INTPTR_TYPE__
-#endif
+#define intptr_t __INTPTR_TYPE__
 
-void *fn1(void *p1, void *p2, long p3)
+void *fn1(void *p1, void *p2, intptr_t p3)
 {
-  long a = (long)p1, b = (long)p2, c = p3;
+  intptr_t a = (intptr_t)p1, b = (intptr_t)p2, c = p3;
 
   while (c)
     {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c
index c456d73..bea0f89 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c
@@ -300,9 +300,9 @@ f2 (struct C *x)
 	  else
 	    {
 	      o = f2 (x);
-#if __SIZEOF_POINTER__ == __SIZEOF_LONG__
+#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ && !__MSP430X_LARGE__
 	      if (((unsigned long) o > (unsigned long) -4000L))
-#elif __SIZEOF_POINTER__ == __SIZEOF_INT__
+#else
 	  if (((__UINTPTR_TYPE__) o > (__UINTPTR_TYPE__) -4000U))
 #endif
 		{
@@ -388,9 +388,9 @@ f2 (struct C *x)
 	  break;
 	case 19:
 	  o = f2 (x);
-#if __SIZEOF_POINTER__ == __SIZEOF_LONG__
+#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ && !__MSP430X_LARGE__
 	  if (((unsigned long) o > (unsigned long) -4000L))
-#elif __SIZEOF_POINTER__ == __SIZEOF_INT__
+#else
 	  if (((__UINTPTR_TYPE__) o > (__UINTPTR_TYPE__) -4000U))
 #endif
 	    {
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index ced1582..042a3cb 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -8950,3 +8950,10 @@ proc check_effective_target_cet { } {
 proc check_effective_target_newlib_nano_io { } {
     return [check_configured_with "--enable-newlib-nano-formatted-io"]
 }
+proc check_effective_target_msp430_large_mem {} {
+    return [check_no_compiler_messages msp430_large assembly {
+	#ifndef __MSP430X_LARGE__
+	#error
+	#endif
+    } ""]
+}
-- 
2.7.4


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-14 15:44 ` [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives " Jozef Lawrynowicz
@ 2018-11-14 16:31   ` Paul Koning
  2018-11-14 22:20     ` Jozef Lawrynowicz
  2018-11-14 16:54   ` Andreas Schwab
  1 sibling, 1 reply; 34+ messages in thread
From: Paul Koning @ 2018-11-14 16:31 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: GCC Patches



> On Nov 14, 2018, at 10:44 AM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
> Patch 1 tweaks dg directives in tests specifically for msp430. Many of
> these are extensions to existing target selectors in dg directives.
> 
> <0001-TESTSUITE-MSP430-Tweak-dg-directives-for-msp430-elf.patch>

For pr41779.c, you have

+/* { dg-skip-if "int is smaller than float" { msp430-*-* } } */

I take it that means: sizeof(int) < sizeof(float).  That property also holds for pdp11 and perhaps other targets.  Would it make sense to introduce a new effective-target flag for that check instead?

	paul

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-14 15:44 ` [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives " Jozef Lawrynowicz
  2018-11-14 16:31   ` Paul Koning
@ 2018-11-14 16:54   ` Andreas Schwab
  2018-11-14 18:00     ` Jozef Lawrynowicz
  1 sibling, 1 reply; 34+ messages in thread
From: Andreas Schwab @ 2018-11-14 16:54 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: GCC Patches, Nick Clifton

On Nov 14 2018, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:

> diff --git a/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c b/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
> index 6b1c427..71d24ce 100644
> --- a/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
> +++ b/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
> @@ -1,6 +1,7 @@
>  /* Test __builtin_{add,sub}_overflow on {,un}signed long int.  */
>  /* { dg-do run } */
>  /* { dg-skip-if "" { ! run_expensive_tests }  { "*" } { "-O0" "-O2" } } */
> +/* { dg-timeout 120 { target msp430-*-* } } */

Are you sure you want to _decrease_ the timeout?  The default is 300
seconds.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-14 16:54   ` Andreas Schwab
@ 2018-11-14 18:00     ` Jozef Lawrynowicz
  2018-11-14 18:50       ` Paul Koning
  2018-11-15  9:37       ` Andreas Schwab
  0 siblings, 2 replies; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-14 18:00 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: GCC Patches, Nick Clifton

On 14/11/2018 16:54, Andreas Schwab wrote:
> On Nov 14 2018, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
>
>> diff --git a/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c b/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
>> index 6b1c427..71d24ce 100644
>> --- a/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
>> +++ b/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
>> @@ -1,6 +1,7 @@
>>   /* Test __builtin_{add,sub}_overflow on {,un}signed long int.  */
>>   /* { dg-do run } */
>>   /* { dg-skip-if "" { ! run_expensive_tests }  { "*" } { "-O0" "-O2" } } */
>> +/* { dg-timeout 120 { target msp430-*-* } } */
> Are you sure you want to _decrease_ the timeout?  The default is 300
> seconds.
>
> Andreas.
>
The timeout as set in the dejagnu configuration for msp430 
([dejagnu.git]/baseboards/msp430-sim.exp) is 30, which is rarely hit. 
There are some tests which pass most of of the time but will 
occasionally timeout so maybe the default timeout in dejagnu is worth 
increasing a little as well.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-14 18:00     ` Jozef Lawrynowicz
@ 2018-11-14 18:50       ` Paul Koning
  2018-11-14 19:29         ` Jozef Lawrynowicz
  2018-11-15  9:37       ` Andreas Schwab
  1 sibling, 1 reply; 34+ messages in thread
From: Paul Koning @ 2018-11-14 18:50 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: Andreas Schwab, GCC Patches, Nick Clifton



> On Nov 14, 2018, at 1:00 PM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
> On 14/11/2018 16:54, Andreas Schwab wrote:
>> On Nov 14 2018, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
>> 
>>> diff --git a/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c b/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
>>> index 6b1c427..71d24ce 100644
>>> --- a/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
>>> +++ b/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
>>> @@ -1,6 +1,7 @@
>>>  /* Test __builtin_{add,sub}_overflow on {,un}signed long int.  */
>>>  /* { dg-do run } */
>>>  /* { dg-skip-if "" { ! run_expensive_tests }  { "*" } { "-O0" "-O2" } } */
>>> +/* { dg-timeout 120 { target msp430-*-* } } */
>> Are you sure you want to _decrease_ the timeout?  The default is 300
>> seconds.
>> 
>> Andreas.
>> 
> The timeout as set in the dejagnu configuration for msp430 ([dejagnu.git]/baseboards/msp430-sim.exp) is 30, which is rarely hit. There are some tests which pass most of of the time but will occasionally timeout so maybe the default timeout in dejagnu is worth increasing a little as well.

Would it make sense to use { dg-timeout-factor 4 ... } instead?  That would make it explicit that you're raising rather than lowering the timeout.

	paul


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-14 18:50       ` Paul Koning
@ 2018-11-14 19:29         ` Jozef Lawrynowicz
  0 siblings, 0 replies; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-14 19:29 UTC (permalink / raw)
  To: Paul Koning; +Cc: Andreas Schwab, GCC Patches, Nick Clifton

On 14/11/2018 18:50, Paul Koning wrote:
>
>> On Nov 14, 2018, at 1:00 PM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
>>
>> On 14/11/2018 16:54, Andreas Schwab wrote:
>>> On Nov 14 2018, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
>>>
>>>> diff --git a/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c b/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
>>>> index 6b1c427..71d24ce 100644
>>>> --- a/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
>>>> +++ b/gcc/testsuite/c-c++-common/torture/builtin-arith-overflow-10.c
>>>> @@ -1,6 +1,7 @@
>>>>   /* Test __builtin_{add,sub}_overflow on {,un}signed long int.  */
>>>>   /* { dg-do run } */
>>>>   /* { dg-skip-if "" { ! run_expensive_tests }  { "*" } { "-O0" "-O2" } } */
>>>> +/* { dg-timeout 120 { target msp430-*-* } } */
>>> Are you sure you want to _decrease_ the timeout?  The default is 300
>>> seconds.
>>>
>>> Andreas.
>>>
>> The timeout as set in the dejagnu configuration for msp430 ([dejagnu.git]/baseboards/msp430-sim.exp) is 30, which is rarely hit. There are some tests which pass most of of the time but will occasionally timeout so maybe the default timeout in dejagnu is worth increasing a little as well.
> Would it make sense to use { dg-timeout-factor 4 ... } instead?  That would make it explicit that you're raising rather than lowering the timeout.
>
> 	paul
>
>
Thanks, I wasn't aware of that directive. Using dg-timeout-factor does seem

more appropriate in this case.

Jozef.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-14 16:31   ` Paul Koning
@ 2018-11-14 22:20     ` Jozef Lawrynowicz
  2018-11-15 14:48       ` Paul Koning
  0 siblings, 1 reply; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-14 22:20 UTC (permalink / raw)
  To: Paul Koning; +Cc: GCC Patches

On Wed, 14 Nov 2018 11:30:39 -0500
Paul Koning <paulkoning@comcast.net> wrote:

> > On Nov 14, 2018, at 10:44 AM, Jozef Lawrynowicz <jozef.l@mittosystems.com>
> > wrote:
> > 
> > Patch 1 tweaks dg directives in tests specifically for msp430. Many of
> > these are extensions to existing target selectors in dg directives.
> > 
> > <0001-TESTSUITE-MSP430-Tweak-dg-directives-for-msp430-elf.patch>  
> 
> For pr41779.c, you have
> 
> +/* { dg-skip-if "int is smaller than float" { msp430-*-* } } */
> 
> I take it that means: sizeof(int) < sizeof(float).  That property also holds
> for pdp11 and perhaps other targets.  Would it make sense to introduce a new
> effective-target flag for that check instead?
> 
> 	paul
> 

Paul,

Yes you are correct the comment implies sizeof(int) < sizeof(float).

I believe this was the only test where this property affected the test
results, so a new effective-target flag is probably only worth adding if it
affects at least a couple of tests.
On the other hand, I suppose there is no harm in adding another
check-effective-target and it at least means we'll catch failures across more
targets.

I'd be curious if the line I added the xfail to in c-c++-common/pr57371-2.c
also fails for pdp11.

The conversion to float might be getting optimized out whenever
sizeof(int) < sizeof(float).

Thanks,
Jozef

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-14 18:00     ` Jozef Lawrynowicz
  2018-11-14 18:50       ` Paul Koning
@ 2018-11-15  9:37       ` Andreas Schwab
  2018-11-15 12:09         ` Jozef Lawrynowicz
  1 sibling, 1 reply; 34+ messages in thread
From: Andreas Schwab @ 2018-11-15  9:37 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: GCC Patches, Nick Clifton

On Nov 14 2018, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:

> The timeout as set in the dejagnu configuration for msp430
> ([dejagnu.git]/baseboards/msp430-sim.exp) is 30, which is rarely
> hit.

I don't think it makes sense for a board file to set a smaller timeout
than the default.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-15  9:37       ` Andreas Schwab
@ 2018-11-15 12:09         ` Jozef Lawrynowicz
  0 siblings, 0 replies; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-15 12:09 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: GCC Patches, Nick Clifton

On Thu, 15 Nov 2018 10:36:57 +0100
Andreas Schwab <schwab@suse.de> wrote:

> On Nov 14 2018, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
> > The timeout as set in the dejagnu configuration for msp430
> > ([dejagnu.git]/baseboards/msp430-sim.exp) is 30, which is rarely
> > hit.  
> 
> I don't think it makes sense for a board file to set a smaller timeout
> than the default.
> 
> Andreas.
> 

Hmm, yes I see that some other DejaGNU board files increase the timeout for
GCC but no others are decreasing it.

I suspect this was just an oversight with the initial port of board file.

I'll go ahead and remove the timeout from the board file and
rerun the tests, with those dg-timeout directives also removed.

Thanks,
Jozef

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-14 22:20     ` Jozef Lawrynowicz
@ 2018-11-15 14:48       ` Paul Koning
  2018-11-15 17:49         ` Jozef Lawrynowicz
  0 siblings, 1 reply; 34+ messages in thread
From: Paul Koning @ 2018-11-15 14:48 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: GCC Patches



> On Nov 14, 2018, at 5:19 PM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
> On Wed, 14 Nov 2018 11:30:39 -0500
> Paul Koning <paulkoning@comcast.net> wrote:
> 
>>> On Nov 14, 2018, at 10:44 AM, Jozef Lawrynowicz <jozef.l@mittosystems.com>
>>> wrote:
>>> 
>>> Patch 1 tweaks dg directives in tests specifically for msp430. Many of
>>> these are extensions to existing target selectors in dg directives.
>>> 
>>> <0001-TESTSUITE-MSP430-Tweak-dg-directives-for-msp430-elf.patch>  
>> 
>> For pr41779.c, you have
>> 
>> +/* { dg-skip-if "int is smaller than float" { msp430-*-* } } */
>> 
>> I take it that means: sizeof(int) < sizeof(float).  That property also holds
>> for pdp11 and perhaps other targets.  Would it make sense to introduce a new
>> effective-target flag for that check instead?
>> 
>> 	paul
>> 
> 
> Paul,
> 
> Yes you are correct the comment implies sizeof(int) < sizeof(float).
> 
> I believe this was the only test where this property affected the test
> results, so a new effective-target flag is probably only worth adding if it
> affects at least a couple of tests.
> On the other hand, I suppose there is no harm in adding another
> check-effective-target and it at least means we'll catch failures across more
> targets.
> 
> I'd be curious if the line I added the xfail to in c-c++-common/pr57371-2.c
> also fails for pdp11.
> 
> The conversion to float might be getting optimized out whenever
> sizeof(int) < sizeof(float).
> 
> Thanks,
> Jozef

Yes, that test on pr57371-2.c also fails on pdp11.

	paul

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-15 14:48       ` Paul Koning
@ 2018-11-15 17:49         ` Jozef Lawrynowicz
  0 siblings, 0 replies; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-15 17:49 UTC (permalink / raw)
  To: Paul Koning; +Cc: GCC Patches

On Thu, 15 Nov 2018 09:48:05 -0500
Paul Koning <paulkoning@comcast.net> wrote:

> > On Nov 14, 2018, at 5:19 PM, Jozef Lawrynowicz <jozef.l@mittosystems.com>
> > wrote:
> > 
> > 
> > I'd be curious if the line I added the xfail to in c-c++-common/pr57371-2.c
> > also fails for pdp11.
> > 
> > The conversion to float might be getting optimized out whenever
> > sizeof(int) < sizeof(float).
> > 
> > Thanks,
> > Jozef  
> 
> Yes, that test on pr57371-2.c also fails on pdp11.
> 
> 	paul
> 

Thanks for checking, in that case I'll go ahead an add an effective target for
"int_lt_float".

I'll make a note to investigate that test failure as well. The test
comments:
> We can not get rid of comparison in tests below because of
> potential inexact exception.
If I'm understanding the test correctly, then if the cast to float has been
optimized out, users expecting the inexact float exception to be raised will
have unexpected behaviour.

Jozef

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 1/7][v2][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-14 15:41 [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf Jozef Lawrynowicz
                   ` (6 preceding siblings ...)
  2018-11-14 15:59 ` [PATCH 7/7][MSP430][TESTSUITE] Fix tests for msp430-elf large memory model Jozef Lawrynowicz
@ 2018-11-21 19:05 ` Jozef Lawrynowicz
  2018-11-21 19:19   ` Rainer Orth
  2018-11-21 22:39 ` [PATCH 3/7][v2][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays Jozef Lawrynowicz
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-21 19:05 UTC (permalink / raw)
  To: GCC Patches; +Cc: Nick Clifton, Paul Koning

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

On Wed, 14 Nov 2018 15:41:00 +0000
Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:

> Patch 1 tweaks dg directives in tests specifically for msp430. Many of
> these are extensions to existing target selectors in dg directives.

Made some modifications to patch 1 based on suggestions.
Added int_eq_float and ptr_eq_long effective target procedures.

Re-tested on avr, x86_64-pc-linux-gnu and msp430-elf.

Ok for trunk?

[-- Attachment #2: 0001-TESTSUITE-MSP430-Tweak-dg-directives-for-msp430-elf.patch --]
[-- Type: text/x-patch, Size: 23437 bytes --]

From 1f31a27ab7cf5b7de0c1cfc7e33a39a66cd61146 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Thu, 8 Nov 2018 18:55:57 +0000
Subject: [PATCH] [TESTSUITE][MSP430] Tweak dg-directives for msp430-elf

2018-11-21  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/testsuite/ChangeLog:

	* lib/target-supports.exp
	(check_effective_target_logical_op_short_circuit): Add msp430.
	(check_effective_target_int_eq_float): New. 
	(check_effective_target_ptr_eq_long): New. 
	* c-c++-common/pr41779.c: Require int_eq_float for dg-warning tests.
	* c-c++-common/pr57371-2.c: XFAIL optimized dump scan when
	sizeof (float) != sizeof (int).
	* gcc.dg/pr84670-4.c: Require ptr_eq_long.
	* gcc.dg/pr85859.c: Likewise.
	* gcc.dg/Wno-frame-address.c: Skip for msp430-elf.
	* gcc.dg/torture/stackalign/builtin-apply-2.c: Likewise.
	* gcc.dg/ifcvt-4.c: Likewise.
	* gcc.dg/pr34856.c: Likewise.
	* gcc.dg/builtin-apply2.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-26.c: Likewise.
	* gcc.dg/attr-alloc_size-11.c: Remove dg-warning XFAIL for msp430.
	* gcc.dg/tree-ssa/20040204-1.c: Likewise.
	* gcc.dg/compat/struct-by-value-16a_x.c: Build at -O1 for msp430
	so it fits.
	* gcc.dg/lto/20091013-1_0.c: Require ptr_eq_long.
	* gcc.dg/lto/20091013-1_1.c: Remove xfail-if for when
	sizeof(void *) != sizeof(long).
	* gcc.dg/lto/20091013-1_2.c: Likewise.
	* gcc.dg/tree-ssa/loop-1.c: Fix expected dg-final behaviour for msp430.
	* gcc.dg/tree-ssa/gen-vect-25.c: Likewise.
	* gcc.dg/tree-ssa/gen-vect-11.c: Likewise.
	* gcc.dg/tree-ssa/loop-35.c: Likewise.
	* gcc.dg/tree-ssa/pr23455.c: Likewise.
	* gcc.dg/weak/typeof-2.c: Likewise.
	* gcc.target/msp430/interrupt_fn_placement.c: Skip for 430 ISA.
	* gcc.target/msp430/pr78818-data-region.c: Fix scan-assembler text.
	* gcc.target/msp430/pr79242.c: Don't skip for -msmall.
	* gcc.target/msp430/special-regs.c: Use "__asm__" instead of "asm".
---
 gcc/testsuite/c-c++-common/pr41779.c               |  6 +++---
 gcc/testsuite/c-c++-common/pr57371-2.c             |  2 +-
 gcc/testsuite/gcc.dg/Wno-frame-address.c           |  2 +-
 gcc/testsuite/gcc.dg/attr-alloc_size-11.c          |  4 ++--
 gcc/testsuite/gcc.dg/builtin-apply2.c              |  2 +-
 .../gcc.dg/compat/struct-by-value-16a_x.c          |  2 ++
 gcc/testsuite/gcc.dg/ifcvt-4.c                     |  2 +-
 gcc/testsuite/gcc.dg/lto/20091013-1_0.c            |  1 +
 gcc/testsuite/gcc.dg/lto/20091013-1_1.c            |  1 -
 gcc/testsuite/gcc.dg/lto/20091013-1_2.c            |  1 -
 gcc/testsuite/gcc.dg/pr34856.c                     |  1 +
 gcc/testsuite/gcc.dg/pr84670-4.c                   |  1 +
 gcc/testsuite/gcc.dg/pr85859.c                     |  1 +
 .../gcc.dg/torture/stackalign/builtin-apply-2.c    |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c         |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c        |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c        |  4 ++--
 gcc/testsuite/gcc.dg/tree-ssa/loop-1.c             |  4 ++--
 gcc/testsuite/gcc.dg/tree-ssa/loop-35.c            |  4 ++--
 gcc/testsuite/gcc.dg/tree-ssa/pr23455.c            |  4 ++--
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c         |  1 +
 gcc/testsuite/gcc.dg/weak/typeof-2.c               |  2 ++
 .../gcc.target/msp430/interrupt_fn_placement.c     |  1 +
 .../gcc.target/msp430/pr78818-data-region.c        |  3 ++-
 gcc/testsuite/gcc.target/msp430/pr79242.c          |  2 +-
 gcc/testsuite/gcc.target/msp430/special-regs.c     |  8 ++++----
 gcc/testsuite/lib/target-supports.exp              | 24 ++++++++++++++++++++++
 27 files changed, 61 insertions(+), 28 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/pr41779.c b/gcc/testsuite/c-c++-common/pr41779.c
index c42a0f5..a80bf78 100644
--- a/gcc/testsuite/c-c++-common/pr41779.c
+++ b/gcc/testsuite/c-c++-common/pr41779.c
@@ -1,6 +1,6 @@
 /* PR41779: Wconversion cannot see through real*integer promotions. */
 /* { dg-do compile } */
-/* { dg-skip-if "doubles are floats" { "avr-*-*" } } */
+/* { dg-skip-if "doubles are floats" { avr-*-* } } */
 /* { dg-options "-std=c99 -Wconversion" { target c } } */
 /* { dg-options "-Wconversion" { target c++ } } */
 /* { dg-require-effective-target large_double } */
@@ -27,7 +27,7 @@ float f4(float x, unsigned char y)
 
 float f5(float x, int y)
 {
-  return x * y; /* { dg-warning "conversion" } */
+  return x * y; /* { dg-warning "conversion" "" { target int_eq_float } } */
 }
 
 double c1(float x, unsigned short y, int z)
@@ -52,5 +52,5 @@ double c4(float x, unsigned char y, int z)
 
 double c5(float x, int y, int z)
 {
-  return z ? x + x : y; /* { dg-warning "conversion" } */
+  return z ? x + x : y; /* { dg-warning "conversion" "" { target int_eq_float } } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr57371-2.c b/gcc/testsuite/c-c++-common/pr57371-2.c
index d07cff3..8d11880 100644
--- a/gcc/testsuite/c-c++-common/pr57371-2.c
+++ b/gcc/testsuite/c-c++-common/pr57371-2.c
@@ -8,7 +8,7 @@
 
 int foo1(int x) {
   return (float) x != 0;
-  /* { dg-final { scan-tree-dump "\\(float\\)" "optimized" } } */
+  /* { dg-final { scan-tree-dump "\\(float\\)" "optimized" { xfail { ! int_eq_float } } } } */
 }
 
 int foo2(long long x) {
diff --git a/gcc/testsuite/gcc.dg/Wno-frame-address.c b/gcc/testsuite/gcc.dg/Wno-frame-address.c
index 9fe4d07..11ae0cd 100644
--- a/gcc/testsuite/gcc.dg/Wno-frame-address.c
+++ b/gcc/testsuite/gcc.dg/Wno-frame-address.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-skip-if "Cannot access arbitrary stack frames" { arm*-*-* avr-*-* hppa*-*-* ia64-*-* visium-*-* csky-*-* } } */
+/* { dg-skip-if "Cannot access arbitrary stack frames" { arm*-*-* avr-*-* hppa*-*-* ia64-*-* visium-*-* csky-*-* msp430-*-* } } */
 /* { dg-options "-Werror" } */
 /* { dg-additional-options "-mbackchain" { target { s390*-*-* } } } */
 
diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c
index 7f2fc49..0ac787c 100644
--- a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c
+++ b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c
@@ -47,8 +47,8 @@ typedef __SIZE_TYPE__    size_t;
 
 /* The following tests fail because of missing range information.  The xfail
    exclusions are PR79356.  */
-TEST (signed char, SCHAR_MIN + 2, ALLOC_MAX);   /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for signed char" { xfail { ! { aarch64*-*-* arm*-*-* avr-*-* alpha*-*-* ia64-*-* mips*-*-* pdp11*-*-* powerpc*-*-* sparc*-*-* s390*-*-* visium-*-* } } } } */
-TEST (short, SHRT_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for short" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* avr-*-* ia64-*-* mips*-*-* pdp11*-*-* powerpc*-*-* sparc*-*-* s390x-*-* visium-*-* } } } } */
+TEST (signed char, SCHAR_MIN + 2, ALLOC_MAX);   /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for signed char" { xfail { ! { aarch64*-*-* arm*-*-* avr-*-* alpha*-*-* ia64-*-* mips*-*-* pdp11*-*-* powerpc*-*-* sparc*-*-* s390*-*-* visium-*-* msp430-*-* } } } } */
+TEST (short, SHRT_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for short" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* avr-*-* ia64-*-* mips*-*-* pdp11*-*-* powerpc*-*-* sparc*-*-* s390x-*-* visium-*-* msp430-*-* } } } } */
 TEST (int, INT_MIN + 2, ALLOC_MAX);    /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */
 TEST (int, -3, ALLOC_MAX);             /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */
 TEST (int, -2, ALLOC_MAX);             /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */
diff --git a/gcc/testsuite/gcc.dg/builtin-apply2.c b/gcc/testsuite/gcc.dg/builtin-apply2.c
index 3768caa..b73f946 100644
--- a/gcc/testsuite/gcc.dg/builtin-apply2.c
+++ b/gcc/testsuite/gcc.dg/builtin-apply2.c
@@ -1,7 +1,7 @@
 /* { dg-do run } */
 /* { dg-require-effective-target untyped_assembly } */
 /* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { "avr-*-* nds32*-*-*" } } */
-/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs." { "riscv*-*-*" } } */
+/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs." { "riscv*-*-*" msp430-*-* } } */
 /* { dg-skip-if "Variadic funcs use Base AAPCS.  Normal funcs use VFP variant." { arm*-*-* && arm_hf_eabi } } */
 
 /* PR target/12503 */
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
index f563f6e..ac8397b 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
@@ -1,3 +1,5 @@
+/* { dg-options "-O1" { target msp430-*-* } } */
+
 #include "compat-common.h"
 
 #include "fp-struct-defs.h"
diff --git a/gcc/testsuite/gcc.dg/ifcvt-4.c b/gcc/testsuite/gcc.dg/ifcvt-4.c
index 52827ab..ec142cf 100644
--- a/gcc/testsuite/gcc.dg/ifcvt-4.c
+++ b/gcc/testsuite/gcc.dg/ifcvt-4.c
@@ -2,7 +2,7 @@
 /* { dg-additional-options "-misel" { target { powerpc*-*-* } } } */
 /* { dg-additional-options "-march=z196" { target { s390x-*-* } } } */
 /* { dg-additional-options "-mtune-ctrl=^one_if_conv_insn" { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-skip-if "Multiple set if-conversion not guaranteed on all subtargets" { "arm*-*-* avr-*-* hppa*64*-*-* s390-*-* visium-*-*" riscv*-*-* } }  */
+/* { dg-skip-if "Multiple set if-conversion not guaranteed on all subtargets" { "arm*-*-* avr-*-* hppa*64*-*-* s390-*-* visium-*-*" riscv*-*-* msp430-*-* } }  */
 /* { dg-skip-if "" { "s390x-*-*" } { "-m31" } }  */
 
 typedef int word __attribute__((mode(word)));
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_0.c b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
index 9796770..afceb24 100644
--- a/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
@@ -1,5 +1,6 @@
 /* { dg-lto-do link } */
 /* { dg-require-effective-target fpic } */
+/* { dg-require-effective-target ptr_eq_long } */
 /* { dg-lto-options {{-fPIC -r -nostdlib -flto} {-fPIC -r -nostdlib -O2 -flto}} } */
 /* { dg-extra-ld-options "-flinker-output=nolto-rel" } */
 
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_1.c b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
index c958177..fc74ff7 100644
--- a/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
@@ -1,4 +1,3 @@
-/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" x86_64-*-mingw* } } */
 typedef struct HDC__ { int unused; } *HDC;
 typedef struct HFONT__ { int unused; } *HFONT;
 
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
index 94a4f72..1af49aa 100644
--- a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
@@ -1,4 +1,3 @@
-/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" x86_64-*-mingw* } } */
 typedef struct HDC__ { int unused; } *HDC;
 typedef struct HFONT__ { int unused; } *HFONT;
 
diff --git a/gcc/testsuite/gcc.dg/pr34856.c b/gcc/testsuite/gcc.dg/pr34856.c
index 62041e2..9ae8902 100644
--- a/gcc/testsuite/gcc.dg/pr34856.c
+++ b/gcc/testsuite/gcc.dg/pr34856.c
@@ -2,6 +2,7 @@
 /* { dg-options "-O2" } */
 /* { dg-options "-O2 -msse2" { target { i?86-*-* x86_64-*-* } } } */
 /* { dg-options "-O2 -maltivec" { target { powerpc*-*-linux* && powerpc_altivec_ok } } } */
+/* { dg-skip-if "no vector type for PSImode" { msp430-*-* } { "-mlarge" } { "" } } */
 
 typedef __UINTPTR_TYPE__ uintptr_t;
 
diff --git a/gcc/testsuite/gcc.dg/pr84670-4.c b/gcc/testsuite/gcc.dg/pr84670-4.c
index 00bd13a..0360550 100644
--- a/gcc/testsuite/gcc.dg/pr84670-4.c
+++ b/gcc/testsuite/gcc.dg/pr84670-4.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fwrapv" } */
+/* { dg-require-effective-target ptr_eq_long } */
 
 char *a;
 int b(void)
diff --git a/gcc/testsuite/gcc.dg/pr85859.c b/gcc/testsuite/gcc.dg/pr85859.c
index 96eb967..b1476ba 100644
--- a/gcc/testsuite/gcc.dg/pr85859.c
+++ b/gcc/testsuite/gcc.dg/pr85859.c
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-ftree-tail-merge -Wno-div-by-zero -O2 -fno-dce -fno-isolate-erroneous-paths-dereference -fno-tree-dce -fno-tree-vrp" } */
+/* { dg-require-effective-target ptr_eq_long } */
 
 int b, c, d, e;
 
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
index d033010..e7ffe66 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
@@ -9,7 +9,7 @@
 /* arm_hf_eabi: Variadic funcs use Base AAPCS.  Normal funcs use VFP variant.
    avr: Variadic funcs don't pass arguments in registers, while normal funcs
         do.  */
-/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs" { arm_hf_eabi || { avr-*-* riscv*-*-* } } } */
+/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs" { arm_hf_eabi || { avr-*-* msp430-*-* riscv*-*-* } } } */
 /* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { nds32*-*-* } } */
 /* { dg-require-effective-target untyped_assembly } */
    
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
index a1237cf..66ca83f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
@@ -33,4 +33,4 @@ void test55 (int x, int y)
    that the && should be emitted (based on BRANCH_COST).  Fix this
    by teaching dom to look through && and register all components
    as true.  */
-/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* aarch64*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* nds32*-*-* s390*-*-* sh*-*-* sparc*-*-* spu-*-* visium-*-* x86_64-*-* riscv*-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* aarch64*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* nds32*-*-* s390*-*-* sh*-*-* sparc*-*-* spu-*-* visium-*-* x86_64-*-* riscv*-*-* msp430-*-*" } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
index bb5f248..650e73a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
@@ -30,4 +30,4 @@ int main ()
 }
 
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { avr-*-* msp430-*-* } } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
index 5e3ef8d..60ec270 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
@@ -54,5 +54,5 @@ int main (void)
   return main_1 (n + 2, (int *) &n);
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { ! avr-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { ! { avr-*-* msp430-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! { avr-*-* msp430-*-* } } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
index 1862750..6ac6202 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
@@ -43,10 +43,10 @@ int xxx(void)
 /* The SH targets always use separate instructions to load the address
    and to do the actual call - bsr is only generated by link time
    relaxation.  */
-/* CRIS keeps the address in a register.  */
+/* CRIS and MSP430 keep the address in a register.  */
 /* m68k sometimes puts the address in a register, depending on CPU and PIC.  */
 
-/* { dg-final { scan-assembler-times "foo" 5 { xfail hppa*-*-* ia64*-*-* sh*-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* i?86-*-mingw* i?86-*-cygwin* x86_64-*-mingw* visium-*-* nvptx*-*-* } } } */
+/* { dg-final { scan-assembler-times "foo" 5 { xfail hppa*-*-* ia64*-*-* sh*-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* i?86-*-mingw* i?86-*-cygwin* x86_64-*-mingw* visium-*-* nvptx*-*-* msp430-*-* } } } */
 /* { dg-final { scan-assembler-times "foo,%r" 5 { target hppa*-*-* } } } */
 /* { dg-final { scan-assembler-times "= foo"  5 { target ia64*-*-* } } } */
 /* { dg-final { scan-assembler-times "call\[ \t\]*_foo" 5 { target i?86-*-mingw* i?86-*-cygwin* } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
index 4e9d03a..ce63f97 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
@@ -67,5 +67,5 @@ void test4(struct a *A, unsigned LONG b)
     }
 }
 /* long index not hoisted for avr target PR 36561 */
-/* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim2" { xfail { "avr-*-*" } } } } */
-/* { dg-final { scan-tree-dump-times "Executing store motion of" 6 "lim2" { target { "avr-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim2" { xfail { avr-*-* msp430-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 6 "lim2" { target { avr-*-* msp430-*-* } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c b/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c
index fec3540..f336c98 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c
@@ -25,5 +25,5 @@ bi_windup(unsigned int *outbuf, unsigned int bi_buf)
 /* We should eliminate one load of outcnt, which will in turn let us eliminate
    one multiply of outcnt which will in turn let us eliminate
    one add involving outcnt and outbuf.  */
-/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "pre" {target { ! avr-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "pre" {target {   avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "pre" { target { ! { avr-*-* msp430-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "pre" { target avr-*-* msp430-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
index 8e0a24a..32d6389 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-dse1-details -fno-short-enums" } */
+/* { dg-skip-if "temporary variable for constraint_expr is never used" { msp430-*-* } } */
 
 enum constraint_expr_type
 {
diff --git a/gcc/testsuite/gcc.dg/weak/typeof-2.c b/gcc/testsuite/gcc.dg/weak/typeof-2.c
index d4273e3..51995ca 100644
--- a/gcc/testsuite/gcc.dg/weak/typeof-2.c
+++ b/gcc/testsuite/gcc.dg/weak/typeof-2.c
@@ -48,6 +48,8 @@ int bar3 (int x)
 // { dg-final { if [string match m68k-*-* $target_triplet ] {return} } }
 // Likewise for moxie targets.
 // { dg-final { if [string match moxie-*-* $target_triplet ] {return} } }
+// Likewise for msp430 targets.
+// { dg-final { if [string match msp430-*-* $target_triplet ] {return} } }
 // Likewise for Visium targets.
 // { dg-final { if [string match visium-*-* $target_triplet ] {return} } }
 // { dg-final { scan-assembler "baz3.*baz3.*baz3.*baz3.*baz3.*baz3" } }
diff --git a/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c b/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c
index c88bfc3..b8fd5e6 100644
--- a/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c
+++ b/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-skip-if "" { "*-*-*" } { "-mcpu=msp430" } { "" } } */
 /* { dg-options "-mlarge -mcode-region=either -ffunction-sections" } */
 /* { dg-final { scan-assembler-not "\\.either\\.lowtext" } } */
 
diff --git a/gcc/testsuite/gcc.target/msp430/pr78818-data-region.c b/gcc/testsuite/gcc.target/msp430/pr78818-data-region.c
index 22b1fa2..3244c0a 100644
--- a/gcc/testsuite/gcc.target/msp430/pr78818-data-region.c
+++ b/gcc/testsuite/gcc.target/msp430/pr78818-data-region.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mdata-region=either" } */
 
-/* { dg-final { scan-assembler-not "\\.either" } } */
+/* { dg-final { scan-assembler-not "\\.either\\.data" } } */
+/* { dg-final { scan-assembler-not "\\.either\\.bss" } } */
 
 #include "pr78818-real.c"
diff --git a/gcc/testsuite/gcc.target/msp430/pr79242.c b/gcc/testsuite/gcc.target/msp430/pr79242.c
index d7ff8d3..9de8fe0 100644
--- a/gcc/testsuite/gcc.target/msp430/pr79242.c
+++ b/gcc/testsuite/gcc.target/msp430/pr79242.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-skip-if "" { "*-*-*" } { "-mcpu=msp430" "-msmall" } { "" } } */
+/* { dg-skip-if "" { "*-*-*" } { "-mcpu=msp430" } { "" } } */
 /* { dg-options "-mcpu=msp430x" } */
 
 typedef _Complex __int20 C;
diff --git a/gcc/testsuite/gcc.target/msp430/special-regs.c b/gcc/testsuite/gcc.target/msp430/special-regs.c
index c9121e6..a7ae9d0 100644
--- a/gcc/testsuite/gcc.target/msp430/special-regs.c
+++ b/gcc/testsuite/gcc.target/msp430/special-regs.c
@@ -7,10 +7,10 @@ int foo (void)
   register int cg1 __asm__("R2"); /* { dg-error "the register specified for 'cg1' is not general enough" } */
   register int cg2 __asm__("R3"); /* { dg-error "the register specified for 'cg2' is not general enough" } */
 
-  asm("" : "=r"(pc));
-  asm("" : "=r"(sp));
-  asm("" : "=r"(cg1));
-  asm("" : "=r"(cg2));
+  __asm__("" : "=r"(pc));
+  __asm__("" : "=r"(sp));
+  __asm__("" : "=r"(cg1));
+  __asm__("" : "=r"(cg2));
 
   return pc + sp + cg1 + cg2;
 }
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index fd74c04..0f34fb6 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2651,6 +2651,29 @@ proc check_effective_target_long_neq_int { } {
     }]
 }
 
+# Return 1 if int size is equal to float size,
+# 0 otherwise.
+
+proc check_effective_target_int_eq_float { } {
+    return [check_no_compiler_messages int_eq_float object {
+	int dummy[sizeof (int) >= sizeof (float) ? 1 : -1];
+    }]
+}
+
+# Return 1 if pointer size is equal to long size,
+# 0 otherwise.
+
+proc check_effective_target_ptr_eq_long { } {
+    # sizeof (void *) == 4 for msp430-elf -mlarge which is equal to
+    # sizeof (long). Avoid false positive.
+    if { [istarget msp430-*-*] } {
+	return 0
+    }
+    return [check_no_compiler_messages ptr_eq_long object {
+	int dummy[sizeof (void *) == sizeof (long) ? 1 : -1];
+    }]
+}
+
 # Return 1 if the target supports long double larger than double,
 # 0 otherwise.
 
@@ -8388,6 +8411,7 @@ proc check_effective_target_logical_op_short_circuit {} {
 	 || [istarget crisv32-*-*] || [istarget cris-*-*]
 	 || [istarget csky*-*-*]
 	 || [istarget mmix-*-*]
+	 || [istarget msp430-*-*]
 	 || [istarget s390*-*-*]
 	 || [istarget powerpc*-*-*]
 	 || [istarget nios2*-*-*]
-- 
2.7.4


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][v2][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-21 19:05 ` [PATCH 1/7][v2][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf Jozef Lawrynowicz
@ 2018-11-21 19:19   ` Rainer Orth
  2018-11-21 20:42     ` Jozef Lawrynowicz
  0 siblings, 1 reply; 34+ messages in thread
From: Rainer Orth @ 2018-11-21 19:19 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: GCC Patches, Nick Clifton, Paul Koning

Hi Jozef,

> On Wed, 14 Nov 2018 15:41:00 +0000
> Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
>
>> Patch 1 tweaks dg directives in tests specifically for msp430. Many of
>> these are extensions to existing target selectors in dg directives.
>
> Made some modifications to patch 1 based on suggestions.
> Added int_eq_float and ptr_eq_long effective target procedures.
>
> Re-tested on avr, x86_64-pc-linux-gnu and msp430-elf.
>
> Ok for trunk?

new effective-target keywords always need documenting in
gcc/doc/sourcebuild.texi.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][v2][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-21 19:19   ` Rainer Orth
@ 2018-11-21 20:42     ` Jozef Lawrynowicz
  2018-11-26 23:43       ` Jeff Law
  0 siblings, 1 reply; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-21 20:42 UTC (permalink / raw)
  To: Rainer Orth; +Cc: GCC Patches, Nick Clifton, Paul Koning

[-- Attachment #1: Type: text/plain, Size: 325 bytes --]

On Wed, 21 Nov 2018 20:19:29 +0100
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:

> new effective-target keywords always need documenting in
> gcc/doc/sourcebuild.texi.
> 
> 	Rainer
> 

Whoops, thanks for the heads up, fixed in attached.

I'll add documentation for the keywords added in the other patches as well.

Jozef

[-- Attachment #2: 0001-TESTSUITE-MSP430-Tweak-dg-directives-for-msp430-elf.patch --]
[-- Type: text/x-patch, Size: 24206 bytes --]

From be96391838c65b297589ac47ad6347f55ea713c0 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Thu, 8 Nov 2018 18:55:57 +0000
Subject: [PATCH] [TESTSUITE][MSP430] Tweak dg-directives for msp430-elf

2018-11-21  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/ChangeLog:

	* doc/sourcebuild.texi: Document check_effective_target_int_eq_float
	and check_effective_target_ptr_eq_long.

	gcc/testsuite/ChangeLog:

	* lib/target-supports.exp
	(check_effective_target_logical_op_short_circuit): Add msp430.
	(check_effective_target_int_eq_float): New. 
	(check_effective_target_ptr_eq_long): New. 
	* c-c++-common/pr41779.c: Require int_eq_float for dg-warning tests.
	* c-c++-common/pr57371-2.c: XFAIL optimized dump scan when
	sizeof (float) != sizeof (int).
	* gcc.dg/pr84670-4.c: Require ptr_eq_long.
	* gcc.dg/pr85859.c: Likewise.
	* gcc.dg/Wno-frame-address.c: Skip for msp430-elf.
	* gcc.dg/torture/stackalign/builtin-apply-2.c: Likewise.
	* gcc.dg/ifcvt-4.c: Likewise.
	* gcc.dg/pr34856.c: Likewise.
	* gcc.dg/builtin-apply2.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-26.c: Likewise.
	* gcc.dg/attr-alloc_size-11.c: Remove dg-warning XFAIL for msp430.
	* gcc.dg/tree-ssa/20040204-1.c: Likewise.
	* gcc.dg/compat/struct-by-value-16a_x.c: Build at -O1 for msp430
	so it fits.
	* gcc.dg/lto/20091013-1_0.c: Require ptr_eq_long.
	* gcc.dg/lto/20091013-1_1.c: Remove xfail-if for when
	sizeof(void *) != sizeof(long).
	* gcc.dg/lto/20091013-1_2.c: Likewise.
	* gcc.dg/tree-ssa/loop-1.c: Fix expected dg-final behaviour for msp430.
	* gcc.dg/tree-ssa/gen-vect-25.c: Likewise.
	* gcc.dg/tree-ssa/gen-vect-11.c: Likewise.
	* gcc.dg/tree-ssa/loop-35.c: Likewise.
	* gcc.dg/tree-ssa/pr23455.c: Likewise.
	* gcc.dg/weak/typeof-2.c: Likewise.
	* gcc.target/msp430/interrupt_fn_placement.c: Skip for 430 ISA.
	* gcc.target/msp430/pr78818-data-region.c: Fix scan-assembler text.
	* gcc.target/msp430/pr79242.c: Don't skip for -msmall.
	* gcc.target/msp430/special-regs.c: Use "__asm__" instead of "asm".
---
 gcc/doc/sourcebuild.texi                           |  6 ++++++
 gcc/testsuite/c-c++-common/pr41779.c               |  6 +++---
 gcc/testsuite/c-c++-common/pr57371-2.c             |  2 +-
 gcc/testsuite/gcc.dg/Wno-frame-address.c           |  2 +-
 gcc/testsuite/gcc.dg/attr-alloc_size-11.c          |  4 ++--
 gcc/testsuite/gcc.dg/builtin-apply2.c              |  2 +-
 .../gcc.dg/compat/struct-by-value-16a_x.c          |  2 ++
 gcc/testsuite/gcc.dg/ifcvt-4.c                     |  2 +-
 gcc/testsuite/gcc.dg/lto/20091013-1_0.c            |  1 +
 gcc/testsuite/gcc.dg/lto/20091013-1_1.c            |  1 -
 gcc/testsuite/gcc.dg/lto/20091013-1_2.c            |  1 -
 gcc/testsuite/gcc.dg/pr34856.c                     |  1 +
 gcc/testsuite/gcc.dg/pr84670-4.c                   |  1 +
 gcc/testsuite/gcc.dg/pr85859.c                     |  1 +
 .../gcc.dg/torture/stackalign/builtin-apply-2.c    |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c         |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c        |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c        |  4 ++--
 gcc/testsuite/gcc.dg/tree-ssa/loop-1.c             |  4 ++--
 gcc/testsuite/gcc.dg/tree-ssa/loop-35.c            |  4 ++--
 gcc/testsuite/gcc.dg/tree-ssa/pr23455.c            |  4 ++--
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c         |  1 +
 gcc/testsuite/gcc.dg/weak/typeof-2.c               |  2 ++
 .../gcc.target/msp430/interrupt_fn_placement.c     |  1 +
 .../gcc.target/msp430/pr78818-data-region.c        |  3 ++-
 gcc/testsuite/gcc.target/msp430/pr79242.c          |  2 +-
 gcc/testsuite/gcc.target/msp430/special-regs.c     |  8 ++++----
 gcc/testsuite/lib/target-supports.exp              | 24 ++++++++++++++++++++++
 28 files changed, 67 insertions(+), 28 deletions(-)

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 7487977..bca5db3 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1360,6 +1360,12 @@ Target has @code{int} that is 16 bits or shorter.
 @item long_neq_int
 Target has @code{int} and @code{long} with different sizes.
 
+@item int_eq_float
+Target has @code{int} and @code{float} with the same size.
+
+@item ptr_eq_long
+Target has pointers (@code{void *}) and @code{long} with the same size.
+
 @item large_double
 Target supports @code{double} that is longer than @code{float}.
 
diff --git a/gcc/testsuite/c-c++-common/pr41779.c b/gcc/testsuite/c-c++-common/pr41779.c
index c42a0f5..a80bf78 100644
--- a/gcc/testsuite/c-c++-common/pr41779.c
+++ b/gcc/testsuite/c-c++-common/pr41779.c
@@ -1,6 +1,6 @@
 /* PR41779: Wconversion cannot see through real*integer promotions. */
 /* { dg-do compile } */
-/* { dg-skip-if "doubles are floats" { "avr-*-*" } } */
+/* { dg-skip-if "doubles are floats" { avr-*-* } } */
 /* { dg-options "-std=c99 -Wconversion" { target c } } */
 /* { dg-options "-Wconversion" { target c++ } } */
 /* { dg-require-effective-target large_double } */
@@ -27,7 +27,7 @@ float f4(float x, unsigned char y)
 
 float f5(float x, int y)
 {
-  return x * y; /* { dg-warning "conversion" } */
+  return x * y; /* { dg-warning "conversion" "" { target int_eq_float } } */
 }
 
 double c1(float x, unsigned short y, int z)
@@ -52,5 +52,5 @@ double c4(float x, unsigned char y, int z)
 
 double c5(float x, int y, int z)
 {
-  return z ? x + x : y; /* { dg-warning "conversion" } */
+  return z ? x + x : y; /* { dg-warning "conversion" "" { target int_eq_float } } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr57371-2.c b/gcc/testsuite/c-c++-common/pr57371-2.c
index d07cff3..8d11880 100644
--- a/gcc/testsuite/c-c++-common/pr57371-2.c
+++ b/gcc/testsuite/c-c++-common/pr57371-2.c
@@ -8,7 +8,7 @@
 
 int foo1(int x) {
   return (float) x != 0;
-  /* { dg-final { scan-tree-dump "\\(float\\)" "optimized" } } */
+  /* { dg-final { scan-tree-dump "\\(float\\)" "optimized" { xfail { ! int_eq_float } } } } */
 }
 
 int foo2(long long x) {
diff --git a/gcc/testsuite/gcc.dg/Wno-frame-address.c b/gcc/testsuite/gcc.dg/Wno-frame-address.c
index 9fe4d07..11ae0cd 100644
--- a/gcc/testsuite/gcc.dg/Wno-frame-address.c
+++ b/gcc/testsuite/gcc.dg/Wno-frame-address.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-skip-if "Cannot access arbitrary stack frames" { arm*-*-* avr-*-* hppa*-*-* ia64-*-* visium-*-* csky-*-* } } */
+/* { dg-skip-if "Cannot access arbitrary stack frames" { arm*-*-* avr-*-* hppa*-*-* ia64-*-* visium-*-* csky-*-* msp430-*-* } } */
 /* { dg-options "-Werror" } */
 /* { dg-additional-options "-mbackchain" { target { s390*-*-* } } } */
 
diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c
index 7f2fc49..0ac787c 100644
--- a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c
+++ b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c
@@ -47,8 +47,8 @@ typedef __SIZE_TYPE__    size_t;
 
 /* The following tests fail because of missing range information.  The xfail
    exclusions are PR79356.  */
-TEST (signed char, SCHAR_MIN + 2, ALLOC_MAX);   /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for signed char" { xfail { ! { aarch64*-*-* arm*-*-* avr-*-* alpha*-*-* ia64-*-* mips*-*-* pdp11*-*-* powerpc*-*-* sparc*-*-* s390*-*-* visium-*-* } } } } */
-TEST (short, SHRT_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for short" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* avr-*-* ia64-*-* mips*-*-* pdp11*-*-* powerpc*-*-* sparc*-*-* s390x-*-* visium-*-* } } } } */
+TEST (signed char, SCHAR_MIN + 2, ALLOC_MAX);   /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for signed char" { xfail { ! { aarch64*-*-* arm*-*-* avr-*-* alpha*-*-* ia64-*-* mips*-*-* pdp11*-*-* powerpc*-*-* sparc*-*-* s390*-*-* visium-*-* msp430-*-* } } } } */
+TEST (short, SHRT_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for short" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* avr-*-* ia64-*-* mips*-*-* pdp11*-*-* powerpc*-*-* sparc*-*-* s390x-*-* visium-*-* msp430-*-* } } } } */
 TEST (int, INT_MIN + 2, ALLOC_MAX);    /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */
 TEST (int, -3, ALLOC_MAX);             /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */
 TEST (int, -2, ALLOC_MAX);             /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */
diff --git a/gcc/testsuite/gcc.dg/builtin-apply2.c b/gcc/testsuite/gcc.dg/builtin-apply2.c
index 3768caa..b73f946 100644
--- a/gcc/testsuite/gcc.dg/builtin-apply2.c
+++ b/gcc/testsuite/gcc.dg/builtin-apply2.c
@@ -1,7 +1,7 @@
 /* { dg-do run } */
 /* { dg-require-effective-target untyped_assembly } */
 /* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { "avr-*-* nds32*-*-*" } } */
-/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs." { "riscv*-*-*" } } */
+/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs." { "riscv*-*-*" msp430-*-* } } */
 /* { dg-skip-if "Variadic funcs use Base AAPCS.  Normal funcs use VFP variant." { arm*-*-* && arm_hf_eabi } } */
 
 /* PR target/12503 */
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
index f563f6e..ac8397b 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
@@ -1,3 +1,5 @@
+/* { dg-options "-O1" { target msp430-*-* } } */
+
 #include "compat-common.h"
 
 #include "fp-struct-defs.h"
diff --git a/gcc/testsuite/gcc.dg/ifcvt-4.c b/gcc/testsuite/gcc.dg/ifcvt-4.c
index 52827ab..ec142cf 100644
--- a/gcc/testsuite/gcc.dg/ifcvt-4.c
+++ b/gcc/testsuite/gcc.dg/ifcvt-4.c
@@ -2,7 +2,7 @@
 /* { dg-additional-options "-misel" { target { powerpc*-*-* } } } */
 /* { dg-additional-options "-march=z196" { target { s390x-*-* } } } */
 /* { dg-additional-options "-mtune-ctrl=^one_if_conv_insn" { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-skip-if "Multiple set if-conversion not guaranteed on all subtargets" { "arm*-*-* avr-*-* hppa*64*-*-* s390-*-* visium-*-*" riscv*-*-* } }  */
+/* { dg-skip-if "Multiple set if-conversion not guaranteed on all subtargets" { "arm*-*-* avr-*-* hppa*64*-*-* s390-*-* visium-*-*" riscv*-*-* msp430-*-* } }  */
 /* { dg-skip-if "" { "s390x-*-*" } { "-m31" } }  */
 
 typedef int word __attribute__((mode(word)));
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_0.c b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
index 9796770..afceb24 100644
--- a/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
@@ -1,5 +1,6 @@
 /* { dg-lto-do link } */
 /* { dg-require-effective-target fpic } */
+/* { dg-require-effective-target ptr_eq_long } */
 /* { dg-lto-options {{-fPIC -r -nostdlib -flto} {-fPIC -r -nostdlib -O2 -flto}} } */
 /* { dg-extra-ld-options "-flinker-output=nolto-rel" } */
 
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_1.c b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
index c958177..fc74ff7 100644
--- a/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
@@ -1,4 +1,3 @@
-/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" x86_64-*-mingw* } } */
 typedef struct HDC__ { int unused; } *HDC;
 typedef struct HFONT__ { int unused; } *HFONT;
 
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
index 94a4f72..1af49aa 100644
--- a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
@@ -1,4 +1,3 @@
-/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" x86_64-*-mingw* } } */
 typedef struct HDC__ { int unused; } *HDC;
 typedef struct HFONT__ { int unused; } *HFONT;
 
diff --git a/gcc/testsuite/gcc.dg/pr34856.c b/gcc/testsuite/gcc.dg/pr34856.c
index 62041e2..9ae8902 100644
--- a/gcc/testsuite/gcc.dg/pr34856.c
+++ b/gcc/testsuite/gcc.dg/pr34856.c
@@ -2,6 +2,7 @@
 /* { dg-options "-O2" } */
 /* { dg-options "-O2 -msse2" { target { i?86-*-* x86_64-*-* } } } */
 /* { dg-options "-O2 -maltivec" { target { powerpc*-*-linux* && powerpc_altivec_ok } } } */
+/* { dg-skip-if "no vector type for PSImode" { msp430-*-* } { "-mlarge" } { "" } } */
 
 typedef __UINTPTR_TYPE__ uintptr_t;
 
diff --git a/gcc/testsuite/gcc.dg/pr84670-4.c b/gcc/testsuite/gcc.dg/pr84670-4.c
index 00bd13a..0360550 100644
--- a/gcc/testsuite/gcc.dg/pr84670-4.c
+++ b/gcc/testsuite/gcc.dg/pr84670-4.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fwrapv" } */
+/* { dg-require-effective-target ptr_eq_long } */
 
 char *a;
 int b(void)
diff --git a/gcc/testsuite/gcc.dg/pr85859.c b/gcc/testsuite/gcc.dg/pr85859.c
index 96eb967..b1476ba 100644
--- a/gcc/testsuite/gcc.dg/pr85859.c
+++ b/gcc/testsuite/gcc.dg/pr85859.c
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-ftree-tail-merge -Wno-div-by-zero -O2 -fno-dce -fno-isolate-erroneous-paths-dereference -fno-tree-dce -fno-tree-vrp" } */
+/* { dg-require-effective-target ptr_eq_long } */
 
 int b, c, d, e;
 
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
index d033010..e7ffe66 100644
--- a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
@@ -9,7 +9,7 @@
 /* arm_hf_eabi: Variadic funcs use Base AAPCS.  Normal funcs use VFP variant.
    avr: Variadic funcs don't pass arguments in registers, while normal funcs
         do.  */
-/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs" { arm_hf_eabi || { avr-*-* riscv*-*-* } } } */
+/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs" { arm_hf_eabi || { avr-*-* msp430-*-* riscv*-*-* } } } */
 /* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { nds32*-*-* } } */
 /* { dg-require-effective-target untyped_assembly } */
    
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
index a1237cf..66ca83f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
@@ -33,4 +33,4 @@ void test55 (int x, int y)
    that the && should be emitted (based on BRANCH_COST).  Fix this
    by teaching dom to look through && and register all components
    as true.  */
-/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* aarch64*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* nds32*-*-* s390*-*-* sh*-*-* sparc*-*-* spu-*-* visium-*-* x86_64-*-* riscv*-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* aarch64*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* nds32*-*-* s390*-*-* sh*-*-* sparc*-*-* spu-*-* visium-*-* x86_64-*-* riscv*-*-* msp430-*-*" } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
index bb5f248..650e73a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
@@ -30,4 +30,4 @@ int main ()
 }
 
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { avr-*-* msp430-*-* } } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
index 5e3ef8d..60ec270 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
@@ -54,5 +54,5 @@ int main (void)
   return main_1 (n + 2, (int *) &n);
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { ! avr-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { ! { avr-*-* msp430-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! { avr-*-* msp430-*-* } } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
index 1862750..6ac6202 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
@@ -43,10 +43,10 @@ int xxx(void)
 /* The SH targets always use separate instructions to load the address
    and to do the actual call - bsr is only generated by link time
    relaxation.  */
-/* CRIS keeps the address in a register.  */
+/* CRIS and MSP430 keep the address in a register.  */
 /* m68k sometimes puts the address in a register, depending on CPU and PIC.  */
 
-/* { dg-final { scan-assembler-times "foo" 5 { xfail hppa*-*-* ia64*-*-* sh*-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* i?86-*-mingw* i?86-*-cygwin* x86_64-*-mingw* visium-*-* nvptx*-*-* } } } */
+/* { dg-final { scan-assembler-times "foo" 5 { xfail hppa*-*-* ia64*-*-* sh*-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* i?86-*-mingw* i?86-*-cygwin* x86_64-*-mingw* visium-*-* nvptx*-*-* msp430-*-* } } } */
 /* { dg-final { scan-assembler-times "foo,%r" 5 { target hppa*-*-* } } } */
 /* { dg-final { scan-assembler-times "= foo"  5 { target ia64*-*-* } } } */
 /* { dg-final { scan-assembler-times "call\[ \t\]*_foo" 5 { target i?86-*-mingw* i?86-*-cygwin* } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
index 4e9d03a..ce63f97 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
@@ -67,5 +67,5 @@ void test4(struct a *A, unsigned LONG b)
     }
 }
 /* long index not hoisted for avr target PR 36561 */
-/* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim2" { xfail { "avr-*-*" } } } } */
-/* { dg-final { scan-tree-dump-times "Executing store motion of" 6 "lim2" { target { "avr-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim2" { xfail { avr-*-* msp430-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 6 "lim2" { target { avr-*-* msp430-*-* } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c b/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c
index fec3540..f336c98 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c
@@ -25,5 +25,5 @@ bi_windup(unsigned int *outbuf, unsigned int bi_buf)
 /* We should eliminate one load of outcnt, which will in turn let us eliminate
    one multiply of outcnt which will in turn let us eliminate
    one add involving outcnt and outbuf.  */
-/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "pre" {target { ! avr-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "pre" {target {   avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "pre" { target { ! { avr-*-* msp430-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "pre" { target avr-*-* msp430-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
index 8e0a24a..32d6389 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-26.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-dse1-details -fno-short-enums" } */
+/* { dg-skip-if "temporary variable for constraint_expr is never used" { msp430-*-* } } */
 
 enum constraint_expr_type
 {
diff --git a/gcc/testsuite/gcc.dg/weak/typeof-2.c b/gcc/testsuite/gcc.dg/weak/typeof-2.c
index d4273e3..51995ca 100644
--- a/gcc/testsuite/gcc.dg/weak/typeof-2.c
+++ b/gcc/testsuite/gcc.dg/weak/typeof-2.c
@@ -48,6 +48,8 @@ int bar3 (int x)
 // { dg-final { if [string match m68k-*-* $target_triplet ] {return} } }
 // Likewise for moxie targets.
 // { dg-final { if [string match moxie-*-* $target_triplet ] {return} } }
+// Likewise for msp430 targets.
+// { dg-final { if [string match msp430-*-* $target_triplet ] {return} } }
 // Likewise for Visium targets.
 // { dg-final { if [string match visium-*-* $target_triplet ] {return} } }
 // { dg-final { scan-assembler "baz3.*baz3.*baz3.*baz3.*baz3.*baz3" } }
diff --git a/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c b/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c
index c88bfc3..b8fd5e6 100644
--- a/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c
+++ b/gcc/testsuite/gcc.target/msp430/interrupt_fn_placement.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-skip-if "" { "*-*-*" } { "-mcpu=msp430" } { "" } } */
 /* { dg-options "-mlarge -mcode-region=either -ffunction-sections" } */
 /* { dg-final { scan-assembler-not "\\.either\\.lowtext" } } */
 
diff --git a/gcc/testsuite/gcc.target/msp430/pr78818-data-region.c b/gcc/testsuite/gcc.target/msp430/pr78818-data-region.c
index 22b1fa2..3244c0a 100644
--- a/gcc/testsuite/gcc.target/msp430/pr78818-data-region.c
+++ b/gcc/testsuite/gcc.target/msp430/pr78818-data-region.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mdata-region=either" } */
 
-/* { dg-final { scan-assembler-not "\\.either" } } */
+/* { dg-final { scan-assembler-not "\\.either\\.data" } } */
+/* { dg-final { scan-assembler-not "\\.either\\.bss" } } */
 
 #include "pr78818-real.c"
diff --git a/gcc/testsuite/gcc.target/msp430/pr79242.c b/gcc/testsuite/gcc.target/msp430/pr79242.c
index d7ff8d3..9de8fe0 100644
--- a/gcc/testsuite/gcc.target/msp430/pr79242.c
+++ b/gcc/testsuite/gcc.target/msp430/pr79242.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-skip-if "" { "*-*-*" } { "-mcpu=msp430" "-msmall" } { "" } } */
+/* { dg-skip-if "" { "*-*-*" } { "-mcpu=msp430" } { "" } } */
 /* { dg-options "-mcpu=msp430x" } */
 
 typedef _Complex __int20 C;
diff --git a/gcc/testsuite/gcc.target/msp430/special-regs.c b/gcc/testsuite/gcc.target/msp430/special-regs.c
index c9121e6..a7ae9d0 100644
--- a/gcc/testsuite/gcc.target/msp430/special-regs.c
+++ b/gcc/testsuite/gcc.target/msp430/special-regs.c
@@ -7,10 +7,10 @@ int foo (void)
   register int cg1 __asm__("R2"); /* { dg-error "the register specified for 'cg1' is not general enough" } */
   register int cg2 __asm__("R3"); /* { dg-error "the register specified for 'cg2' is not general enough" } */
 
-  asm("" : "=r"(pc));
-  asm("" : "=r"(sp));
-  asm("" : "=r"(cg1));
-  asm("" : "=r"(cg2));
+  __asm__("" : "=r"(pc));
+  __asm__("" : "=r"(sp));
+  __asm__("" : "=r"(cg1));
+  __asm__("" : "=r"(cg2));
 
   return pc + sp + cg1 + cg2;
 }
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index fd74c04..0f34fb6 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2651,6 +2651,29 @@ proc check_effective_target_long_neq_int { } {
     }]
 }
 
+# Return 1 if int size is equal to float size,
+# 0 otherwise.
+
+proc check_effective_target_int_eq_float { } {
+    return [check_no_compiler_messages int_eq_float object {
+	int dummy[sizeof (int) >= sizeof (float) ? 1 : -1];
+    }]
+}
+
+# Return 1 if pointer size is equal to long size,
+# 0 otherwise.
+
+proc check_effective_target_ptr_eq_long { } {
+    # sizeof (void *) == 4 for msp430-elf -mlarge which is equal to
+    # sizeof (long). Avoid false positive.
+    if { [istarget msp430-*-*] } {
+	return 0
+    }
+    return [check_no_compiler_messages ptr_eq_long object {
+	int dummy[sizeof (void *) == sizeof (long) ? 1 : -1];
+    }]
+}
+
 # Return 1 if the target supports long double larger than double,
 # 0 otherwise.
 
@@ -8388,6 +8411,7 @@ proc check_effective_target_logical_op_short_circuit {} {
 	 || [istarget crisv32-*-*] || [istarget cris-*-*]
 	 || [istarget csky*-*-*]
 	 || [istarget mmix-*-*]
+	 || [istarget msp430-*-*]
 	 || [istarget s390*-*-*]
 	 || [istarget powerpc*-*-*]
 	 || [istarget nios2*-*-*]
-- 
2.7.4


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 3/7][v2][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays
  2018-11-14 15:41 [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf Jozef Lawrynowicz
                   ` (7 preceding siblings ...)
  2018-11-21 19:05 ` [PATCH 1/7][v2][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf Jozef Lawrynowicz
@ 2018-11-21 22:39 ` Jozef Lawrynowicz
  2018-11-26 20:20   ` Mike Stump
  2018-11-21 22:41 ` [PATCH 6/7][v2][MSP430][TESTSUITE] Fix tests requiring float printf support when GCC was configured with --enable-newlib-nano-formatted-io Jozef Lawrynowicz
  2018-11-21 22:44 ` [PATCH 7/7][v2][MSP430][TESTSUITE] Fix tests for msp430-elf large memory model Jozef Lawrynowicz
  10 siblings, 1 reply; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-21 22:39 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 767 bytes --]

On Wed, 14 Nov 2018 15:41:00 +0000
Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:

> Patch 3 sets up require-effective-target directives for tests which
> require the compilation of large arrays.
> Targets which have 16-bit or 20-bit size_t fail to compile tests with large
> arrays designed to test 32-bit or 64-bit behaviour. Rather than enumerating
> another target to skip, I've replaced the target selector in some tests with
> a size checking procedure:
> - size20plus (new)
> - size32plus
> size20plus checks to see if a 16-bit structure/array size is supported,
> similarly to how the existing size32plus checks to see if a 24-bit
> structure/array size is supported,

Added missing documentation for new check_effective target procs in attached
patch.


[-- Attachment #2: 0003-TESTSUITE-Dynamically-check-if-size_t-is-large-enoug.patch --]
[-- Type: text/x-patch, Size: 15559 bytes --]

From 1573a8392605a17e58c74be19ee5eb28950dc32d Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Thu, 8 Nov 2018 22:39:12 +0000
Subject: [PATCH] [TESTSUITE] Dynamically check if size_t is large enough for
 tests containing large structs/arrays

2018-11-21  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/ChangeLog:

	* doc/sourcebuild.texi: Document check_effective_target_size20plus.
	Clarify documentation for check_effective_target_size32plus.

	gcc/testsuite/ChangeLog:

	* gcc.c-torture/compile/20151204.c: Add dg-require-effective-target
	size20plus.
	* gcc.dg/pr34225.c: Likewise.
	* gcc.dg/pr40971.c: Likewise.
	* gcc.dg/pr69071.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-10.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-2.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-3.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-5.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-6.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-7.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-8.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-9.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-11.c: Add dg-require-effective-target
	size32plus.
	* gcc.dg/Walloc-size-larger-than-4.c: Likewise.
	* gcc.dg/Walloc-size-larger-than-5.c: Likewise.
	* gcc.dg/Walloc-size-larger-than-6.c: Likewise.
	* gcc.dg/Walloc-size-larger-than-7.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-1.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-1b.c: Likewise.
	* lib/target-supports.exp (check_effective_target_size20plus): New.
	(check_effective_target_size32plus): Update comment. 

---
 gcc/doc/sourcebuild.texi                            |  7 ++++++-
 gcc/testsuite/gcc.c-torture/compile/20151204.c      |  2 +-
 gcc/testsuite/gcc.dg/Walloc-size-larger-than-4.c    |  2 +-
 gcc/testsuite/gcc.dg/Walloc-size-larger-than-5.c    |  2 +-
 gcc/testsuite/gcc.dg/Walloc-size-larger-than-6.c    |  2 +-
 gcc/testsuite/gcc.dg/Walloc-size-larger-than-7.c    |  2 +-
 gcc/testsuite/gcc.dg/pr34225.c                      |  1 +
 gcc/testsuite/gcc.dg/pr40971.c                      |  1 +
 gcc/testsuite/gcc.dg/pr69071.c                      |  2 +-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-11.c |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1b.c |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-2.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-3.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-5.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-6.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-7.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-8.c  |  3 ++-
 gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-9.c  |  3 ++-
 gcc/testsuite/lib/target-supports.exp               | 18 +++++++++++++++---
 21 files changed, 51 insertions(+), 21 deletions(-)

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index bca5db3..9c57226 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1375,8 +1375,13 @@ Target supports @code{long double} that is longer than @code{double}.
 @item ptr32plus
 Target has pointers that are 32 bits or longer.
 
+@item size20plus
+Target has a 20-bit or larger address space, so at least supports
+16-bit array and structure sizes.
+
 @item size32plus
-Target supports array and structure sizes that are 32 bits or longer.
+Target has a 32-bit or larger address space, so at least supports
+24-bit array and structure sizes.
 
 @item 4byte_wchar_t
 Target has @code{wchar_t} that is at least 4 bytes.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20151204.c b/gcc/testsuite/gcc.c-torture/compile/20151204.c
index 6a46abf..e41f6c1 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20151204.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20151204.c
@@ -1,4 +1,4 @@
-/* { dg-skip-if "Array too big" { "avr-*-*" "pdp11-*-*" } } */
+/* { dg-require-effective-target size20plus } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-4.c b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-4.c
index 4b3a64b..54e43cd 100644
--- a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-4.c
+++ b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-4.c
@@ -1,6 +1,6 @@
 /* PR middle-end/82063 - issues with arguments enabled by -Wall
    { dg-do compile }
-   { dg-skip-if "small address space" { "pdp11-*-*" } }
+   { dg-require-effective-target size32plus }
    { dg-options "-O -Walloc-size-larger-than=1MiB -ftrack-macro-expansion=0" } */
 
 void sink (void*);
diff --git a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-5.c b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-5.c
index 4217ad6..774c4cf 100644
--- a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-5.c
+++ b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-5.c
@@ -1,6 +1,6 @@
 /* PR middle-end/82063 - issues with arguments enabled by -Wall
    { dg-do compile }
-   { dg-skip-if "small address space" { "pdp11-*-*" } }
+   { dg-require-effective-target size32plus }
    { dg-options "-O -Walloc-size-larger-than=1MB -ftrack-macro-expansion=0" } */
 
 void sink (void*);
diff --git a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-6.c b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-6.c
index a46fce7..2dfc663 100644
--- a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-6.c
+++ b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-6.c
@@ -1,6 +1,6 @@
 /* PR middle-end/82063 - issues with arguments enabled by -Wall
    { dg-do compile }
-   { dg-skip-if "small address space" { "pdp11-*-*" } }
+   { dg-require-effective-target size32plus }
    { dg-options "-O -Walloc-size-larger-than=1GiB -ftrack-macro-expansion=0" } */
 
 void sink (void*);
diff --git a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-7.c b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-7.c
index 4d9aafd..2cc517f 100644
--- a/gcc/testsuite/gcc.dg/Walloc-size-larger-than-7.c
+++ b/gcc/testsuite/gcc.dg/Walloc-size-larger-than-7.c
@@ -1,6 +1,6 @@
 /* PR middle-end/82063 - issues with arguments enabled by -Wall
    { dg-do compile }
-   { dg-skip-if "small address space" { "pdp11-*-*" } }
+   { dg-require-effective-target size32plus }
    { dg-options "-O -Walloc-size-larger-than=1GB -ftrack-macro-expansion=0" } */
 
 void sink (void*);
diff --git a/gcc/testsuite/gcc.dg/pr34225.c b/gcc/testsuite/gcc.dg/pr34225.c
index 659e176..e337340 100644
--- a/gcc/testsuite/gcc.dg/pr34225.c
+++ b/gcc/testsuite/gcc.dg/pr34225.c
@@ -2,6 +2,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fno-strict-aliasing -fstack-protector" } */
 /* { dg-require-effective-target fstack_protector } */
+/* { dg-require-effective-target size20plus } */
 
 typedef __SIZE_TYPE__ size_t;
 extern int sscanf (const char *, const char *, ...);
diff --git a/gcc/testsuite/gcc.dg/pr40971.c b/gcc/testsuite/gcc.dg/pr40971.c
index 31dfd5e..4317638 100644
--- a/gcc/testsuite/gcc.dg/pr40971.c
+++ b/gcc/testsuite/gcc.dg/pr40971.c
@@ -2,6 +2,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O -fstack-protector -fno-strict-aliasing" } */
 /* { dg-require-effective-target fstack_protector } */
+/* { dg-require-effective-target size20plus } */
 
 extern void bar (char *);
 
diff --git a/gcc/testsuite/gcc.dg/pr69071.c b/gcc/testsuite/gcc.dg/pr69071.c
index 0396bbc..3ae3811 100644
--- a/gcc/testsuite/gcc.dg/pr69071.c
+++ b/gcc/testsuite/gcc.dg/pr69071.c
@@ -1,7 +1,7 @@
 /* PR target/69071 */
 /* { dg-do compile } */
 /* { dg-options "-O2 -g" } */
-/* { dg-skip-if "Array too big" { "avr-*-*" } } */
+/* { dg-require-effective-target size20plus } */
 
 void *bar (void *);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1.c
index 4a81e12..c7ebaef 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fassociative-math -fno-signed-zeros -fno-trapping-math -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 /* Copied from graphite/interchange-4.c */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c
index 5735756..8f5a9a0 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-10.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-11.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-11.c
index 2a1b340..413b81e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-11.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-11.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1b.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1b.c
index 7de2b40..a3063bb 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1b.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-1b.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 /* Copied from graphite/interchange-4.c */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-2.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-2.c
index 247adc9..fbd46a2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-2.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 /* Copied from graphite/interchange-5.c */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-3.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-3.c
index b239230..8028e36 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-3.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big stack" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big stack" { visium-*-* } } */
 
 /* Copied from graphite/interchange-6.c */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-5.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-5.c
index 8f13cd4..81050a8 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-5.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M], c[M][M], d[M][M];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-6.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-6.c
index a38fd9d..8a2692e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-6.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M], c[M][M], d[M][M];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-7.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-7.c
index e6ad26f..d55c1e2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-7.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M], c[M][M], d[M][M];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-8.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-8.c
index 5ed300a..391b8a4 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-8.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-8.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M], c[M][M], d[M][M];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-9.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-9.c
index a984e47..b5fda2d 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-9.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-9.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
-/* { dg-skip-if "too big data segment" { avr-*-* visium-*-* } } */
+/* { dg-require-effective-target size20plus } */
+/* { dg-skip-if "too big data segment" { visium-*-* } } */
 
 #define M 256
 int a[M][M], b[M][M], c[M], d[M];
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 73f86ee..8a91f79 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2600,9 +2600,21 @@ proc check_effective_target_ptr32plus { } {
     }]
 }
 
-# Return 1 if we support 32-bit or larger array and structure sizes
-# using default options, 0 otherwise.  Avoid false positive on
-# targets with 20 or 24 bit address spaces.
+# Return 1 if we support 16-bit or larger array and structure sizes
+# using default options, 0 otherwise.
+# This implies at least a 20-bit address space, as no targets have an address
+# space between 16 and 20 bits.
+
+proc check_effective_target_size20plus { } {
+    return [check_no_compiler_messages size20plus object {
+	char dummy[65537L];
+    }]
+}
+
+# Return 1 if we support 24-bit or larger array and structure sizes
+# using default options, 0 otherwise.
+# This implies at least a 32-bit address space, as no targets have an address
+# space between 24 and 32 bits.
 
 proc check_effective_target_size32plus { } {
     return [check_no_compiler_messages size32plus object {
-- 
2.7.4


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 6/7][v2][MSP430][TESTSUITE] Fix tests requiring float printf support when GCC was configured with --enable-newlib-nano-formatted-io
  2018-11-14 15:41 [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf Jozef Lawrynowicz
                   ` (8 preceding siblings ...)
  2018-11-21 22:39 ` [PATCH 3/7][v2][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays Jozef Lawrynowicz
@ 2018-11-21 22:41 ` Jozef Lawrynowicz
  2018-11-21 22:44 ` [PATCH 7/7][v2][MSP430][TESTSUITE] Fix tests for msp430-elf large memory model Jozef Lawrynowicz
  10 siblings, 0 replies; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-21 22:41 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

On Wed, 14 Nov 2018 15:41:00 +0000
Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:

> Patch 6 fixes tests expecting printf float support for targets which have been
> configured with "newlib-nano-formatted-io". When newlib is configured in this
> way, float printf is enabled at build time by registering _printf_float as an
> undefined symbol.

Added missing documentation for new check_effective target procs in attached
patch.


[-- Attachment #2: 0006-TESTSUITE-Fix-tests-requiring-float-printf-support-w.patch --]
[-- Type: text/x-patch, Size: 4115 bytes --]

From ad5c2e3684904f961938cfc0b50445013300c6e0 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Sat, 10 Nov 2018 16:02:25 +0000
Subject: [PATCH] [TESTSUITE] Fix tests requiring float printf support when GCC
 was configured with --enable-newlib-nano-formatted-io

2018-11-21  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/ChangeLog:

	* doc/sourcebuild.texi: Document check_effective_target_newlib_nano_io.

	gcc/testsuite/ChangeLog:

	* lib/target-supports.exp (check_effective_target_newlib_nano_io): New. 
	* gcc.c-torture/execute/920501-8.c: Register undefined linker symbol
	_printf_float for newlib_nano_io target.
	* gcc.c-torture/execute/930513-1.c: Likewise.
	* gcc.dg/torture/builtin-sprintf.c: Likewise.
	* gcc.c-torture/execute/ieee/920810-1.x: New.
---
 gcc/doc/sourcebuild.texi                            | 4 ++++
 gcc/testsuite/gcc.c-torture/execute/920501-8.c      | 2 ++
 gcc/testsuite/gcc.c-torture/execute/930513-1.c      | 2 ++
 gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x | 4 ++++
 gcc/testsuite/gcc.dg/torture/builtin-sprintf.c      | 3 ++-
 gcc/testsuite/lib/target-supports.exp               | 4 ++++
 6 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 9c57226..bfaa0fd 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2152,6 +2152,10 @@ Target supports @code{mmap}.
 @item newlib
 Target supports Newlib.
 
+@item newlib_nano_io
+GCC was configured with @code{--enable-newlib-nano-formatted-io}, which reduces
+the code size of Newlib formatted I/O functions.
+
 @item pow10
 Target provides @code{pow10} function.
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/920501-8.c b/gcc/testsuite/gcc.c-torture/execute/920501-8.c
index 62780a0..7e4fa17 100644
--- a/gcc/testsuite/gcc.c-torture/execute/920501-8.c
+++ b/gcc/testsuite/gcc.c-torture/execute/920501-8.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-Wl,-u,_printf_float" { target newlib_nano_io } } */
+
 #include <stdio.h>
 #include <stdarg.h>
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/930513-1.c b/gcc/testsuite/gcc.c-torture/execute/930513-1.c
index 4544471..f163007 100644
--- a/gcc/testsuite/gcc.c-torture/execute/930513-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/930513-1.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-Wl,-u,_printf_float" { target newlib_nano_io } } */
+
 #include <stdio.h>
 char buf[2];
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x
new file mode 100644
index 0000000..8edec730
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x
@@ -0,0 +1,4 @@
+if { [check_effective_target_newlib_nano_io] } {
+    lappend additional_flags "-Wl,-u,_printf_float"
+}
+return 0
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-sprintf.c b/gcc/testsuite/gcc.dg/torture/builtin-sprintf.c
index 6f8b7a9..5684fd7 100644
--- a/gcc/testsuite/gcc.dg/torture/builtin-sprintf.c
+++ b/gcc/testsuite/gcc.dg/torture/builtin-sprintf.c
@@ -1,6 +1,7 @@
 /* PR tree-optimization/86274 - SEGFAULT when logging std::to_string(NAN)
    { dg-do run }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall" }
+   { dg-additional-options "-Wl,-u,_printf_float" { target newlib_nano_io } } */
 
 #define X        "0xdeadbeef"
 #define nan(x)   __builtin_nan (x)
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 7488653..d696fc6 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -6691,6 +6691,10 @@ proc check_effective_target_newlib {} {
 	#include <newlib.h>
     }]
 }
+# Return true if GCC was configured with --enable-newlib-nano-formatted-io
+proc check_effective_target_newlib_nano_io { } {
+    return [check_configured_with "--enable-newlib-nano-formatted-io"]
+}
 
 # Some newlib versions don't provide a frexpl and instead depend
 # on frexp to implement long double conversions in their printf-like
-- 
2.7.4


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 7/7][v2][MSP430][TESTSUITE] Fix tests for msp430-elf large memory model
  2018-11-14 15:41 [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf Jozef Lawrynowicz
                   ` (9 preceding siblings ...)
  2018-11-21 22:41 ` [PATCH 6/7][v2][MSP430][TESTSUITE] Fix tests requiring float printf support when GCC was configured with --enable-newlib-nano-formatted-io Jozef Lawrynowicz
@ 2018-11-21 22:44 ` Jozef Lawrynowicz
  10 siblings, 0 replies; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-21 22:44 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

On Wed, 14 Nov 2018 15:41:00 +0000
Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:

> Patch 7 fixes tests for msp430-elf in the large memory model.

Added missing documentation for new check_effective target procs in attached
patch.



[-- Attachment #2: 0007-TESTSUITE-Fix-tests-for-msp430-elf-large-memory-mode.patch --]
[-- Type: text/x-patch, Size: 17826 bytes --]

From 4cfb2ecd0e0580f69790fadd68b77e8a82992ef4 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Sat, 10 Nov 2018 16:08:44 +0000
Subject: [PATCH] [TESTSUITE] Fix tests for msp430-elf large memory model

2018-11-21  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/ChangeLog:

	* doc/sourcebuild.texi: Document
	check_effective_target_msp430_large_mem.

	gcc/testsuite/ChangeLog:

	* gcc.c-torture/execute/991014-1.c: Fix bufsize definition for
	msp430 large memory model.
	* gcc.dg/Walloca-1.c: Don't expect warning for msp430 large memory
	model.
	* gcc.dg/Walloca-2.c: Likewise.
	* gcc.dg/c99-const-expr-2.c: Define ZERO macro for msp430 large memory
	model.
	* gcc.dg/format/format.h: Prefix typedefs using __SIZE_TYPE__ and
	__PTRDIFF_TYPE__ with __extension__.
	* gcc.dg/lto/20081210-1_0.c: Always typedef uintptr_t as
	__UINTPTR_TYPE__.
	* gcc.dg/pr36227.c: Likewise.
	* gcc.dg/pr42611.c: Use __INTPTR_MAX__ as the maximum object size if
	size_t and ptr_t are the same size.
	* gcc.dg/pr78973.c: dg-warning XFAIL for int16 but not msp430 large
	memory model.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Update dg-warning
	directives for msp430 large memory model.
	* gcc.dg/tree-ssa/pr66449.c: Always use __INTPTR_TYPE__ when integer
	type equal in size to ptr_t is required.
	* gcc.dg/tree-ssa/ssa-dom-thread-8.c: Extend pointer size checking
	macro for msp430.
	* lib/target-supports.exp (check_effective_target_msp430_large_mem):
	New. 
---
 gcc/doc/sourcebuild.texi                           |  8 ++++++
 gcc/testsuite/gcc.c-torture/execute/991014-1.c     |  7 ++++-
 gcc/testsuite/gcc.dg/Walloca-1.c                   |  4 +--
 gcc/testsuite/gcc.dg/Walloca-2.c                   |  8 +++---
 gcc/testsuite/gcc.dg/c99-const-expr-2.c            |  2 ++
 gcc/testsuite/gcc.dg/format/format.h               |  6 ++--
 gcc/testsuite/gcc.dg/lto/20081210-1_0.c            |  8 +-----
 gcc/testsuite/gcc.dg/pr36227.c                     | 10 +------
 gcc/testsuite/gcc.dg/pr42611.c                     |  3 +-
 gcc/testsuite/gcc.dg/pr78973.c                     |  2 +-
 .../gcc.dg/tree-ssa/builtin-sprintf-warn-3.c       | 32 +++++++++++-----------
 gcc/testsuite/gcc.dg/tree-ssa/pr66449.c            |  8 ++----
 gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c   |  8 +++---
 gcc/testsuite/lib/target-supports.exp              | 13 +++++++++
 14 files changed, 66 insertions(+), 53 deletions(-)

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index bfaa0fd..b5fac4e 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1941,6 +1941,14 @@ when using the new ABI.
 MIPS target supports @code{-mpaired-single}.
 @end table
 
+@subsubsection MSP430-specific attributes
+
+@table @code
+@item msp430_large_mem
+The MSP430 large memory model (enabled with @code{-mlarge} compiler flag)
+is in use.
+@end table
+
 @subsubsection PowerPC-specific attributes
 
 @table @code
diff --git a/gcc/testsuite/gcc.c-torture/execute/991014-1.c b/gcc/testsuite/gcc.c-torture/execute/991014-1.c
index e0bcd6d..95e38ce 100644
--- a/gcc/testsuite/gcc.c-torture/execute/991014-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/991014-1.c
@@ -1,11 +1,16 @@
-
 typedef __SIZE_TYPE__ Size_t;
 
+#ifdef __MSP430X_LARGE__
+/* size_t is __int20, so 20 bits, for __MSP430X_LARGE__, but __SIZEOF_POINTER__
+   returns the bytesize which is 4.  */
+#define bufsize ((1L << (20 - 2))-256)
+#else  /* !__MSP430X_LARGE__ */
 #if __SIZEOF_LONG__ < __SIZEOF_POINTER__
 #define bufsize ((1LL << (8 * sizeof(Size_t) - 2))-256)
 #else
 #define bufsize ((1L << (8 * sizeof(Size_t) - 2))-256)
 #endif
+#endif
 
 struct huge_struct
 {
diff --git a/gcc/testsuite/gcc.dg/Walloca-1.c b/gcc/testsuite/gcc.dg/Walloca-1.c
index 85e9160..c9a6c57 100644
--- a/gcc/testsuite/gcc.dg/Walloca-1.c
+++ b/gcc/testsuite/gcc.dg/Walloca-1.c
@@ -24,8 +24,8 @@ void foo1 (size_t len, size_t len2, size_t len3)
   char *s = alloca (123);
   useit (s);			// OK, constant argument to alloca
 
-  s = alloca (num);		// { dg-warning "large due to conversion" "" { target lp64 } }
-  // { dg-warning "unbounded use of 'alloca'" "" { target { ! lp64 } } .-1 }
+  s = alloca (num);		// { dg-warning "large due to conversion" "" { target { { lp64 } || { msp430_large_mem } } } }
+  // { dg-warning "unbounded use of 'alloca'" "" { target { { ! lp64 } && { ! msp430_large_mem } } } .-1 }
   useit (s);
 
   s = alloca (30000);		/* { dg-warning "is too large" } */
diff --git a/gcc/testsuite/gcc.dg/Walloca-2.c b/gcc/testsuite/gcc.dg/Walloca-2.c
index 766ff8d..446c811 100644
--- a/gcc/testsuite/gcc.dg/Walloca-2.c
+++ b/gcc/testsuite/gcc.dg/Walloca-2.c
@@ -13,7 +13,7 @@ g1 (int n)
     // 32-bit targets because VRP is not giving us any range info for
     // the argument to __builtin_alloca.  This should be fixed by the
     // upcoming range work.
-    p = __builtin_alloca (n); // { dg-bogus "unbounded use of 'alloca'" "" { xfail { ! lp64 } } }
+    p = __builtin_alloca (n); // { dg-bogus "unbounded use of 'alloca'" "" { xfail { { ! lp64 } && { ! msp430_large_mem } } } }
   else
     p = __builtin_malloc (n);
   f (p);
@@ -36,9 +36,9 @@ g3 (int n)
   void *p;
   if (n > 0 && n < 3000)
     {
-      p = __builtin_alloca (n); // { dg-warning "'alloca' may be too large" "" { target lp64} }
-      // { dg-message "note:.*argument may be as large as 2999" "note" { target lp64 } .-1 }
-      // { dg-warning "unbounded use of 'alloca'" "" { target { ! lp64 } } .-2 }
+      p = __builtin_alloca (n); // { dg-warning "'alloca' may be too large" "" { target { lp64 || msp430_large_mem } } }
+      // { dg-message "note:.*argument may be as large as 2999" "note" { target { lp64 || msp430_large_mem } } .-1 }
+      // { dg-warning "unbounded use of 'alloca'" "" { target { { ! lp64 } && { ! msp430_large_mem } } } .-2 }
     }
   else
     p = __builtin_malloc (n);
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-2.c b/gcc/testsuite/gcc.dg/c99-const-expr-2.c
index a78e412..2b85706 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-2.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-2.c
@@ -18,6 +18,8 @@ long *c;
 #define ZERO 0L
 #elif defined(_WIN64)
 #define ZERO 0LL
+#elif defined(__MSP430X_LARGE__)
+#define ZERO (__int20)0
 #else
 #define ZERO 0
 #endif
diff --git a/gcc/testsuite/gcc.dg/format/format.h b/gcc/testsuite/gcc.dg/format/format.h
index a99927e..2d0a71b 100644
--- a/gcc/testsuite/gcc.dg/format/format.h
+++ b/gcc/testsuite/gcc.dg/format/format.h
@@ -58,12 +58,12 @@ __extension__ typedef unsigned int ullong  __attribute__ ((mode (DI)));
 #else
 /* Kludges to get types corresponding to size_t and ptrdiff_t.  */
 #define unsigned signed
-typedef __SIZE_TYPE__ signed_size_t;
+__extension__ typedef __SIZE_TYPE__ signed_size_t;
 /* We also use this type to approximate ssize_t.  */
-typedef __SIZE_TYPE__ ssize_t;
+__extension__ typedef __SIZE_TYPE__ ssize_t;
 #undef unsigned
 #define signed /* Type might or might not have explicit 'signed'.  */
-typedef unsigned __PTRDIFF_TYPE__ unsigned_ptrdiff_t;
+__extension__ typedef unsigned __PTRDIFF_TYPE__ unsigned_ptrdiff_t;
 #undef signed
 
 __extension__ typedef long long int llong;
diff --git a/gcc/testsuite/gcc.dg/lto/20081210-1_0.c b/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
index 80a1e9a..8048b26 100644
--- a/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
+++ b/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
@@ -1,10 +1,4 @@
-#if defined(_LP64)
-typedef unsigned long int uintptr_t;
-#elif defined (_WIN64)
-typedef unsigned long long int uintptr_t;
-#else
-typedef unsigned int uintptr_t;
-#endif
+typedef __UINTPTR_TYPE__ uintptr_t;
 
 extern void srand (uintptr_t);
 
diff --git a/gcc/testsuite/gcc.dg/pr36227.c b/gcc/testsuite/gcc.dg/pr36227.c
index 27fe001..ba0d722 100644
--- a/gcc/testsuite/gcc.dg/pr36227.c
+++ b/gcc/testsuite/gcc.dg/pr36227.c
@@ -1,14 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -Wstrict-overflow=3" } */
-#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__)
-typedef unsigned long long ptrcast;
-#elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__)
-typedef unsigned long ptrcast;
-#elif (__SIZEOF_INT__ == __SIZEOF_POINTER__)
-typedef unsigned int ptrcast;
-#else
-#error Add target support here
-#endif
+typedef __UINTPTR_TYPE__ ptrcast;
 
 volatile unsigned long *
 sat_add(volatile unsigned long *ptr, unsigned long i, volatile unsigned long *end)
diff --git a/gcc/testsuite/gcc.dg/pr42611.c b/gcc/testsuite/gcc.dg/pr42611.c
index 0426ce2..f502fea 100644
--- a/gcc/testsuite/gcc.dg/pr42611.c
+++ b/gcc/testsuite/gcc.dg/pr42611.c
@@ -3,7 +3,8 @@
 /* { dg-options "" } */
 
 #define L \
-  (sizeof (__SIZE_TYPE__) == 1 ? __SCHAR_MAX__				\
+  (sizeof (__SIZE_TYPE__) == sizeof (void *) ? __INTPTR_MAX__ \
+  : sizeof (__SIZE_TYPE__) == 1 ? __SCHAR_MAX__				\
   : sizeof (__SIZE_TYPE__) == sizeof (short) ? __SHRT_MAX__		\
   : sizeof (__SIZE_TYPE__) == sizeof (int) ? __INT_MAX__		\
   : sizeof (__SIZE_TYPE__) == sizeof (long) ? __LONG_MAX__		\
diff --git a/gcc/testsuite/gcc.dg/pr78973.c b/gcc/testsuite/gcc.dg/pr78973.c
index 6c53f89..e0148bbc 100644
--- a/gcc/testsuite/gcc.dg/pr78973.c
+++ b/gcc/testsuite/gcc.dg/pr78973.c
@@ -9,7 +9,7 @@
 void f (void *p, int n)
 {
   if (n <= 4)
-    __builtin_memset (p, 0, n);   /* { dg-warning "exceeds maximum object size" "pr79073" { xfail ilp32 } } */
+    __builtin_memset (p, 0, n);   /* { dg-warning "exceeds maximum object size" "pr79073" { xfail { ilp32 || { int16 && { ! msp430_large_mem } } } } } */
 }
 
 void g (void *d, unsigned n)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c
index d06248b..30a44a1 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c
@@ -357,35 +357,35 @@ void test_too_large (char *d, int x, __builtin_va_list va)
   const size_t imax_p1 = imax + 1;
 
   __builtin_snprintf (d, imax,    "%c", x);
-  __builtin_snprintf (d, imax_p1, "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */
-  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */
+  __builtin_snprintf (d, imax_p1, "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large_mem } } } */
+  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { ilp32 } || { int16 && { ! msp430_large_mem } } } } .-1 } */
 
   __builtin_vsnprintf (d, imax,    "%c", va);
-  __builtin_vsnprintf (d, imax_p1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */
-  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */
+  __builtin_vsnprintf (d, imax_p1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large_mem } } } */
+  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { ilp32 } || { int16 && { ! msp430_large_mem } } } } .-1 } */
 
   __builtin___snprintf_chk (d, imax,    0, imax,    "%c", x);
-  __builtin___snprintf_chk (d, imax_p1, 0, imax_p1, "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */
-  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */
+  __builtin___snprintf_chk (d, imax_p1, 0, imax_p1, "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large_mem } } } */
+  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { ilp32 } || { int16 && { ! msp430_large_mem } } } } .-1 } */
 
   __builtin___vsnprintf_chk (d, imax,    0, imax,    "%c", va);
-  __builtin___vsnprintf_chk (d, imax_p1, 0, imax_p1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */
-  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */
+  __builtin___vsnprintf_chk (d, imax_p1, 0, imax_p1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target { lp64 || msp430_large_mem } } } */
+  /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { ilp32 } || { int16 && { ! msp430_large_mem } } } } .-1 } */
 
   const size_t ptrmax = __PTRDIFF_MAX__;
   const size_t ptrmax_m1 = ptrmax - 1;
 
-  __builtin_snprintf (d, ptrmax_m1, "%c", x);  /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */
-  __builtin_snprintf (d, ptrmax, "  %c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */
+  __builtin_snprintf (d, ptrmax_m1, "%c", x);  /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large_mem } } } */
+  __builtin_snprintf (d, ptrmax, "  %c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large_mem } } } */
 
-  __builtin_vsnprintf (d, ptrmax_m1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */
-  __builtin_vsnprintf (d, ptrmax,    "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */
+  __builtin_vsnprintf (d, ptrmax_m1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large_mem } } } */
+  __builtin_vsnprintf (d, ptrmax,    "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large_mem } } } */
 
-  __builtin___snprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */
-  __builtin___snprintf_chk (d, ptrmax,    0, ptrmax,    "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */
+  __builtin___snprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large_mem } } } */
+  __builtin___snprintf_chk (d, ptrmax,    0, ptrmax,    "%c", x);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large_mem } } } */
 
-  __builtin___vsnprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target lp64 } } */
-  __builtin___vsnprintf_chk (d, ptrmax,    0, ptrmax,    "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target lp64 } } */
+  __builtin___vsnprintf_chk (d, ptrmax_m1, 0, ptrmax_m1, "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX - 1" { target { lp64 || msp430_large_mem } } } */
+  __builtin___vsnprintf_chk (d, ptrmax,    0, ptrmax,    "%c", va);   /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "PTRDIFF_MAX" { target { lp64 || msp430_large_mem } } } */
 }
 
 /* Exercise ordinary sprintf with malloc.  */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr66449.c b/gcc/testsuite/gcc.dg/tree-ssa/pr66449.c
index cce26eb..3b6de12 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr66449.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr66449.c
@@ -1,13 +1,11 @@
 /* { dg-do compile } */
 /* { dg-options "-O3" } */
 
-#if __SIZEOF_POINTER__ != __SIZEOF_LONG__
-#define long __INTPTR_TYPE__
-#endif
+#define intptr_t __INTPTR_TYPE__
 
-void *fn1(void *p1, void *p2, long p3)
+void *fn1(void *p1, void *p2, intptr_t p3)
 {
-  long a = (long)p1, b = (long)p2, c = p3;
+  intptr_t a = (intptr_t)p1, b = (intptr_t)p2, c = p3;
 
   while (c)
     {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c
index c456d73..bea0f89 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c
@@ -300,9 +300,9 @@ f2 (struct C *x)
 	  else
 	    {
 	      o = f2 (x);
-#if __SIZEOF_POINTER__ == __SIZEOF_LONG__
+#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ && !__MSP430X_LARGE__
 	      if (((unsigned long) o > (unsigned long) -4000L))
-#elif __SIZEOF_POINTER__ == __SIZEOF_INT__
+#else
 	  if (((__UINTPTR_TYPE__) o > (__UINTPTR_TYPE__) -4000U))
 #endif
 		{
@@ -388,9 +388,9 @@ f2 (struct C *x)
 	  break;
 	case 19:
 	  o = f2 (x);
-#if __SIZEOF_POINTER__ == __SIZEOF_LONG__
+#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ && !__MSP430X_LARGE__
 	  if (((unsigned long) o > (unsigned long) -4000L))
-#elif __SIZEOF_POINTER__ == __SIZEOF_INT__
+#else
 	  if (((__UINTPTR_TYPE__) o > (__UINTPTR_TYPE__) -4000U))
 #endif
 	    {
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index d696fc6..7a714af 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1333,6 +1333,19 @@ proc check_effective_target_mips_eabi { } {
     }]
 }
 
+# Return true if the MSP430 large memory model is enabled, i.e. the -mlarge
+# command line flag has been passed.
+proc check_effective_target_msp430_large_mem {} {
+    if { ![istarget msp430-*-*] } {
+	return 0
+    }
+    return [check_no_compiler_messages msp430_large assembly {
+	#ifndef __MSP430X_LARGE__
+	#error
+	#endif
+    } ""]
+}
+
 # Return 1 if the current multilib does not generate PIC by default.
 
 proc check_effective_target_nonpic { } {
-- 
2.7.4


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 3/7][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays
  2018-11-14 15:49 ` [PATCH 3/7][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays Jozef Lawrynowicz
@ 2018-11-26 20:16   ` Mike Stump
  0 siblings, 0 replies; 34+ messages in thread
From: Mike Stump @ 2018-11-26 20:16 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: GCC Patches, Nick Clifton

On Nov 14, 2018, at 7:48 AM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
> Patch 3 sets up require-effective-target directives for tests which
> require the compilation of large arrays.

Ok.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 3/7][v2][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays
  2018-11-21 22:39 ` [PATCH 3/7][v2][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays Jozef Lawrynowicz
@ 2018-11-26 20:20   ` Mike Stump
  2018-11-26 21:28     ` Jozef Lawrynowicz
  0 siblings, 1 reply; 34+ messages in thread
From: Mike Stump @ 2018-11-26 20:20 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: GCC Patches

On Nov 21, 2018, at 2:39 PM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
> On Wed, 14 Nov 2018 15:41:00 +0000
> Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
>> Patch 3 sets up require-effective-target directives for tests which
>> require the compilation of large arrays.
>> Targets which have 16-bit or 20-bit size_t fail to compile tests with large
>> arrays designed to test 32-bit or 64-bit behaviour. Rather than enumerating
>> another target to skip, I've replaced the target selector in some tests with
>> a size checking procedure:
>> - size20plus (new)
>> - size32plus
>> size20plus checks to see if a 16-bit structure/array size is supported,
>> similarly to how the existing size32plus checks to see if a 24-bit
>> structure/array size is supported,
> 
> Added missing documentation for new check_effective target procs in attached
> patch.

Ok as well.

I'm assuming that pdp and avr are not negatively affected.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 6/7][MSP430][TESTSUITE] Fix tests requiring float printf support when GCC was configured with --enable-newlib-nano-formatted-io
  2018-11-14 15:58 ` [PATCH 6/7][MSP430][TESTSUITE] Fix tests requiring float printf support when GCC was configured with --enable-newlib-nano-formatted-io Jozef Lawrynowicz
@ 2018-11-26 20:26   ` Mike Stump
  0 siblings, 0 replies; 34+ messages in thread
From: Mike Stump @ 2018-11-26 20:26 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: GCC Patches, Nick Clifton

On Nov 14, 2018, at 7:58 AM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
> Patch 6 fixes tests expecting printf float support for targets which have been
> configured with "newlib-nano-formatted-io". When newlib is configured in this
> way, float printf is enabled at build time by registering _printf_float as an
> undefined symbol.

Ok.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 4/7][MSP430][TESTSUITE] Fix tests when int is 16-bit by default
  2018-11-14 15:52 ` [PATCH 4/7][MSP430][TESTSUITE] Fix tests when int is 16-bit by default Jozef Lawrynowicz
@ 2018-11-26 20:39   ` Mike Stump
  0 siblings, 0 replies; 34+ messages in thread
From: Mike Stump @ 2018-11-26 20:39 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: GCC Patches, Nick Clifton

On Nov 14, 2018, at 7:52 AM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
> Patch 4 fixes tests when int is 16-bits by default.

Ok,

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 5/7][MSP430][TESTSUITE] Prune messages about ISO C not supporting __int20 from output of tests
  2018-11-14 15:56 ` [PATCH 5/7][MSP430][TESTSUITE] Prune messages about ISO C not supporting __int20 from output of tests Jozef Lawrynowicz
@ 2018-11-26 20:51   ` Mike Stump
  2018-11-26 23:07     ` Jozef Lawrynowicz
  0 siblings, 1 reply; 34+ messages in thread
From: Mike Stump @ 2018-11-26 20:51 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: GCC Patches, Nick Clifton

On Nov 14, 2018, at 7:56 AM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
> Patch 5 deals with ISO C errors emitted by tests when the large memory model is
> used. size_t and ptrdiff_t are __int20 with -mlarge, and if the test is
> compiled with -pedantic-errors and -std=* or -ansi, then use of these types
> causes an error of the form:
>  ISO C does not support __int20 types
> I fixed this by adding dg-prune-output directives to tests which cause this
> error.

So, it is important that standard code not produce errors.  Kinda fundamental.

I think this should be fixed in some other way.  If a type is to be used as a standard type, producing an error for that type's use is wrong.  Instead, find a way (cough, __extension__), to mark or not warn (error) for it instead.



> 
> Alternatively, I considered adding typedefs preceded by  __extension__ to fix
> these errors, but in many cases __SIZE_TYPE__ is directly used

Can you fix __SIZE_TYPE__ itself to have __extension__ in it?  If not, then I'd find another way to remove that warning for the type.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 3/7][v2][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays
  2018-11-26 20:20   ` Mike Stump
@ 2018-11-26 21:28     ` Jozef Lawrynowicz
  0 siblings, 0 replies; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-26 21:28 UTC (permalink / raw)
  To: Mike Stump; +Cc: GCC Patches

On Mon, 26 Nov 2018 12:20:10 -0800
Mike Stump <mikestump@comcast.net> wrote:

> On Nov 21, 2018, at 2:39 PM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> > 
> > On Wed, 14 Nov 2018 15:41:00 +0000
> > Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> >   
> >> Patch 3 sets up require-effective-target directives for tests which
> >> require the compilation of large arrays.
> >> Targets which have 16-bit or 20-bit size_t fail to compile tests with large
> >> arrays designed to test 32-bit or 64-bit behaviour. Rather than enumerating
> >> another target to skip, I've replaced the target selector in some tests with
> >> a size checking procedure:
> >> - size20plus (new)
> >> - size32plus
> >> size20plus checks to see if a 16-bit structure/array size is supported,
> >> similarly to how the existing size32plus checks to see if a 24-bit
> >> structure/array size is supported,  
> > 
> > Added missing documentation for new check_effective target procs in attached
> > patch.  
> 
> Ok as well.
> 
> I'm assuming that pdp and avr are not negatively affected.

Hi, yes I verified that avr results for the tests I changed are not negatively
affected. The only status change for the tests I modified is FAIL->UNSUPPORTED.

pdp11 has a 16-bit address space, the same msp430 in the small
memory model so there shouldn't be any changes there either.

Thanks for the review, applied.

Jozef

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 5/7][MSP430][TESTSUITE] Prune messages about ISO C not supporting __int20 from output of tests
  2018-11-26 20:51   ` Mike Stump
@ 2018-11-26 23:07     ` Jozef Lawrynowicz
  2018-11-27 18:50       ` Mike Stump
  0 siblings, 1 reply; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-26 23:07 UTC (permalink / raw)
  To: Mike Stump; +Cc: GCC Patches, Nick Clifton

[-- Attachment #1: Type: text/plain, Size: 2523 bytes --]

On Mon, 26 Nov 2018 12:51:26 -0800
Mike Stump <mikestump@comcast.net> wrote:

> On Nov 14, 2018, at 7:56 AM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> > 
> > Patch 5 deals with ISO C errors emitted by tests when the large memory model is
> > used. size_t and ptrdiff_t are __int20 with -mlarge, and if the test is
> > compiled with -pedantic-errors and -std=* or -ansi, then use of these types
> > causes an error of the form:
> >  ISO C does not support __int20 types
> > I fixed this by adding dg-prune-output directives to tests which cause this
> > error.  
> 
> So, it is important that standard code not produce errors.  Kinda fundamental.
> 
> I think this should be fixed in some other way.  If a type is to be used as a standard type, producing an error for that type's use is wrong.  Instead, find a way (cough, __extension__), to mark or not warn (error) for it instead.

Thanks for the feedback.

> Can you fix __SIZE_TYPE__ itself to have __extension__ in it?  If not, then I'd find another way to remove that warning for the type.

It appears you can actually add __extension__ everywhere (that I tried), except
for the argument types in the declaration of a function i.e.
	foo (__extension__ __SIZE_TYPE__ a)
doesn't work.

So I added __extension__ where possible, and in a couple of other cases I
instead typedef'd with __extension__.

Fixed patch attached. For tests which check for messages on specific lines,
those line numbers remain unchanged. 
Ok for trunk?

2018-11-26  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

        Fix __int20 ISO C errors for msp430-elf -mlarge.

        gcc/testsuite/ChangeLog:

        * gcc.dg/addr_builtin-1.c: Add __extension__ before usage of
        __SIZE_TYPE__ and __UINTPTR_TYPE__.
        * gcc.dg/vla-11.c: Likewise.
        * gcc.dg/c11-static-assert-3.c: Add __extension__ before usage of
        __SIZE_TYPE__.
        * gcc.dg/c11-uni-string-1.c: Likewise.
        * gcc.dg/c99-const-expr-10.c: Likewise.
        * gcc.dg/c99-const-expr-9.c: Likewise.
        * gcc.dg/c99-init-1.c: Likewise.
        * gcc.dg/pr52549.c: Likewise.
        * gcc.dg/pr71558.c: Likewise.
        * gcc.dg/pr77587.c: Likewise.
        * gcc.dg/pr79223.c: Likewise.
        * gcc.dg/vla-9.c: Likewise.
        * gcc.dg/c99-const-expr-6.c: Add __extension__ before usage of
        __INTPTR_TYPE__.
        * gcc.dg/c99-stdint-5.c: Likewise.
        * gcc.dg/c99-stdint-6.c: Likewise.
        * gcc.dg/pr61240.c: Add __extension__ before usage of __PTRDIFF_TYPE_.

[-- Attachment #2: new-isoc.diff --]
[-- Type: text/x-patch, Size: 10783 bytes --]

diff --git a/gcc/testsuite/gcc.dg/addr_builtin-1.c b/gcc/testsuite/gcc.dg/addr_builtin-1.c
index 4a0888a..d7ad785 100644
--- a/gcc/testsuite/gcc.dg/addr_builtin-1.c
+++ b/gcc/testsuite/gcc.dg/addr_builtin-1.c
@@ -2,7 +2,7 @@
    { dg-do compile }  */
 
 typedef void (F)(void);
-typedef __UINTPTR_TYPE__ uintptr_t;
+__extension__ typedef __UINTPTR_TYPE__ uintptr_t;
 
 /* Utility function to test passing built-in functions as an ordinary
    argument and via the ellipsis.  */
@@ -122,7 +122,7 @@ static F* test_taking_address_of_gcc_builtin (void)
    of a user-declared function that's also a GCC built-in.  */
 extern int abs (int);
 
-extern __SIZE_TYPE__ strlen (const char*);
+__extension__ extern __SIZE_TYPE__ strlen (const char*);
 
 /* Taking the address of a builtin with a library "fallback" must be
    allowed, either using the __builtin_xxx form or the xxx form, when
@@ -147,7 +147,7 @@ void test_taking_address_of_library_builtin (int i)
   }
 
   {
-    typedef __SIZE_TYPE__ size_t;
+    __extension__ typedef __SIZE_TYPE__ size_t;
     typedef size_t F (const char*);
 
     /* Compute the address of libc's strlen using the implicitly
diff --git a/gcc/testsuite/gcc.dg/c11-static-assert-3.c b/gcc/testsuite/gcc.dg/c11-static-assert-3.c
index 9799b97..25a9346 100644
--- a/gcc/testsuite/gcc.dg/c11-static-assert-3.c
+++ b/gcc/testsuite/gcc.dg/c11-static-assert-3.c
@@ -5,7 +5,7 @@
 _Static_assert (__INT_MAX__ * 2, "overflow"); /* { dg-warning "integer overflow in expression" } */
 /* { dg-error "overflow in constant expression" "error" { target *-*-* } .-1 } */
 
-_Static_assert ((void *)(__SIZE_TYPE__)16, "non-integer"); /* { dg-error "not an integer" } */
+_Static_assert (__extension__ (void *)(__SIZE_TYPE__)16, "non-integer"); /* { dg-error "not an integer" } */
 
 _Static_assert (1.0, "non-integer"); /* { dg-error "not an integer" } */
 
diff --git a/gcc/testsuite/gcc.dg/c11-uni-string-1.c b/gcc/testsuite/gcc.dg/c11-uni-string-1.c
index 9f86bea..6ace5e0 100644
--- a/gcc/testsuite/gcc.dg/c11-uni-string-1.c
+++ b/gcc/testsuite/gcc.dg/c11-uni-string-1.c
@@ -8,7 +8,7 @@
 
 typedef __CHAR16_TYPE__ char16_t;
 typedef __CHAR32_TYPE__ char32_t;
-typedef __SIZE_TYPE__ size_t;
+__extension__ typedef __SIZE_TYPE__ size_t;
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-10.c b/gcc/testsuite/gcc.dg/c99-const-expr-10.c
index 2aca610..0a81953 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-10.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-10.c
@@ -4,25 +4,25 @@
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
-
-void *p = (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
-struct s { void *a; } q = { (__SIZE_TYPE__)(void *)0 }; /* { dg-error "without a cast|near initialization" } */
+__extension__ typedef __SIZE_TYPE__ size_t;
+void *p = (size_t)(void *)0; /* { dg-error "without a cast" } */
+struct s { void *a; } q = { (size_t)(void *)0 }; /* { dg-error "without a cast|near initialization" } */
 void *
 f (void)
 {
   void *r;
-  r = (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
-  return (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
+  r = (size_t)(void *)0; /* { dg-error "without a cast" } */
+  return (size_t)(void *)0; /* { dg-error "without a cast" } */
 }
 void g (void *); /* { dg-message "but argument is of type" } */
 void
 h (void)
 {
-  g ((__SIZE_TYPE__)(void *)0); /* { dg-error "without a cast" } */
+  g ((size_t)(void *)0); /* { dg-error "without a cast" } */
 }
 void g2 (int, void *); /* { dg-message "but argument is of type" } */
 void
 h2 (void)
 {
-  g2 (0, (__SIZE_TYPE__)(void *)0); /* { dg-error "without a cast" } */
+  g2 (0, (size_t)(void *)0); /* { dg-error "without a cast" } */
 }
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-6.c b/gcc/testsuite/gcc.dg/c99-const-expr-6.c
index ca60243..ecb048b 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-6.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-6.c
@@ -8,7 +8,7 @@
 int n = 0, p[n * 0 + 1]; /* { dg-error "variabl" } */
 
 /* PR 31871.  */
-extern int c[1 + ((__INTPTR_TYPE__) (void *) 0)]; /* { dg-error "variab" } */
+extern int c[1 + (__extension__ (__INTPTR_TYPE__) (void *) 0)]; /* { dg-error "variab" } */
 
 /* Implicit conversions from floating-point constants are not OK,
    although explicit ones are.  */
@@ -32,7 +32,7 @@ struct s {
 };
 
 enum e {
-  E = (1 + ((__INTPTR_TYPE__) (void *) 0)), /* { dg-error "constant" } */
+  E = (1 + (__extension__ (__INTPTR_TYPE__) (void *) 0)), /* { dg-error "constant" } */
   E2 = 0
 };
 
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-9.c b/gcc/testsuite/gcc.dg/c99-const-expr-9.c
index 11e0b2c..371e105 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-9.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-9.c
@@ -14,7 +14,7 @@ struct t {
   int b[2];
 };
 
-#define old_offsetof(TYPE, MEMBER) ((__SIZE_TYPE__)(__UINTPTR_TYPE__) &((TYPE *)0)->MEMBER)
+#define old_offsetof(TYPE, MEMBER) (__extension__ (__SIZE_TYPE__)(__UINTPTR_TYPE__) &((TYPE *)0)->MEMBER)
 
 enum e {
   E1 = old_offsetof (struct s, a), /* { dg-error "constant" } */
diff --git a/gcc/testsuite/gcc.dg/c99-init-1.c b/gcc/testsuite/gcc.dg/c99-init-1.c
index 95803c2..cefcfef 100644
--- a/gcc/testsuite/gcc.dg/c99-init-1.c
+++ b/gcc/testsuite/gcc.dg/c99-init-1.c
@@ -3,7 +3,7 @@
 /* { dg-do run } */
 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
 
-typedef __SIZE_TYPE__ size_t;
+__extension__ typedef __SIZE_TYPE__ size_t;
 typedef __WCHAR_TYPE__ wchar_t;
 extern int memcmp (const void *, const void *, size_t);
 extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-5.c b/gcc/testsuite/gcc.dg/c99-stdint-5.c
index 6051323..97cd6f7 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-5.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-5.c
@@ -57,10 +57,10 @@ check_types (void)
   CHECK_TYPES(__UINT_FAST32_TYPE__, uint_fast32_t);
   CHECK_TYPES(__UINT_FAST64_TYPE__, uint_fast64_t);
 #ifdef __INTPTR_TYPE__
-  CHECK_TYPES(__INTPTR_TYPE__, intptr_t);
+  CHECK_TYPES(__extension__ __INTPTR_TYPE__, intptr_t);
 #endif
 #ifdef __UINTPTR_TYPE__
-  CHECK_TYPES(__UINTPTR_TYPE__, uintptr_t);
+  CHECK_TYPES(__extension__ __UINTPTR_TYPE__, uintptr_t);
 #endif
   CHECK_TYPES(__INTMAX_TYPE__, intmax_t);
   CHECK_TYPES(__UINTMAX_TYPE__, uintmax_t);
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-6.c b/gcc/testsuite/gcc.dg/c99-stdint-6.c
index 60ac31f..1075828 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-6.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-6.c
@@ -60,10 +60,10 @@ check_types (void)
   CHECK_TYPES(__UINT_FAST64_TYPE__, uint_fast64_t);
 #endif
 #ifdef __INTPTR_TYPE__
-  CHECK_TYPES(__INTPTR_TYPE__, intptr_t);
+  CHECK_TYPES(__extension__ __INTPTR_TYPE__, intptr_t);
 #endif
 #ifdef __UINTPTR_TYPE__
-  CHECK_TYPES(__UINTPTR_TYPE__, uintptr_t);
+  CHECK_TYPES(__extension__ __UINTPTR_TYPE__, uintptr_t);
 #endif
 #ifndef NO_MAX_TYPES
   CHECK_TYPES(__INTMAX_TYPE__, intmax_t);
diff --git a/gcc/testsuite/gcc.dg/pr52549.c b/gcc/testsuite/gcc.dg/pr52549.c
index 4d0a3e0..faf4e5d 100644
--- a/gcc/testsuite/gcc.dg/pr52549.c
+++ b/gcc/testsuite/gcc.dg/pr52549.c
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
 
 #ifdef __SIZE_TYPE__
-_mark (__SIZE_TYPE__ obj, int i, char *a)
+__extension__ typedef __SIZE_TYPE__ size_t;
+_mark (size_t obj, int i, char *a)
 {
   (char *)&(((long *)(obj)) [i]) - a;
 }
diff --git a/gcc/testsuite/gcc.dg/pr61240.c b/gcc/testsuite/gcc.dg/pr61240.c
index 6332918..8bbb347 100644
--- a/gcc/testsuite/gcc.dg/pr61240.c
+++ b/gcc/testsuite/gcc.dg/pr61240.c
@@ -1,7 +1,7 @@
 /* PR c/61240 */
 /* { dg-do compile } */
 
-typedef __PTRDIFF_TYPE__ ptrdiff_t;
+__extension__ typedef __PTRDIFF_TYPE__ ptrdiff_t;
 
 ptrdiff_t
 foo (ptrdiff_t a[4])
diff --git a/gcc/testsuite/gcc.dg/pr71558.c b/gcc/testsuite/gcc.dg/pr71558.c
index 33a648e..ada830b 100644
--- a/gcc/testsuite/gcc.dg/pr71558.c
+++ b/gcc/testsuite/gcc.dg/pr71558.c
@@ -3,15 +3,17 @@
 /* strcpy must not be pure, but make sure we don't ICE even when
    it is declared incorrectly.  */
 char *strcpy (char *, const char *) __attribute__ ((__pure__));
-__SIZE_TYPE__ strlen (const char *);
-void *malloc (__SIZE_TYPE__);
+__extension__ typedef __SIZE_TYPE__ size_t;
+
+size_t strlen (const char *);
+void *malloc (size_t);
 
 char a[20];
 
 char *
 foo (void)
 {
-  __SIZE_TYPE__ b = strlen (a);
+  size_t b = strlen (a);
   char *c = malloc (b);
   return strcpy (c, a);
 }
diff --git a/gcc/testsuite/gcc.dg/pr77587.c b/gcc/testsuite/gcc.dg/pr77587.c
index 8f5afef..c4a6ebf 100644
--- a/gcc/testsuite/gcc.dg/pr77587.c
+++ b/gcc/testsuite/gcc.dg/pr77587.c
@@ -10,6 +10,6 @@ bar (long x, long y, long z)
   struct __attribute__((aligned (16))) S { long a, b, c, d; } s;
   char *p = (char *) &s;
   __asm ("" : "+r" (p));
-  if (((__UINTPTR_TYPE__) p) & 15)
+  if ((__extension__ (__UINTPTR_TYPE__) p) & 15)
     __builtin_abort ();
 }
diff --git a/gcc/testsuite/gcc.dg/pr79223.c b/gcc/testsuite/gcc.dg/pr79223.c
index ef0dd1b..f043fc4 100644
--- a/gcc/testsuite/gcc.dg/pr79223.c
+++ b/gcc/testsuite/gcc.dg/pr79223.c
@@ -2,7 +2,7 @@
    { dg-do compile }
    { dg-additional-options "-O2 -Wall -Wno-array-bounds -std=gnu99" }  */
 
-typedef __SIZE_TYPE__ size_t;
+__extension__ typedef __SIZE_TYPE__ size_t;
 
 extern void* memcpy (void*, const void*, size_t);
 extern void* mempcpy (void*, const void*, size_t);
diff --git a/gcc/testsuite/gcc.dg/vla-11.c b/gcc/testsuite/gcc.dg/vla-11.c
index 1504853..e2d5488 100644
--- a/gcc/testsuite/gcc.dg/vla-11.c
+++ b/gcc/testsuite/gcc.dg/vla-11.c
@@ -5,8 +5,8 @@
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
 /* { dg-options "-std=c99 -pedantic-errors" } */
-
+__extension__ typedef __SIZE_TYPE__ size_t;
 void foo11a(int x[sizeof(int *(*)[*])]);	/* { dg-warning "not in a declaration" } */
-void foo11b(__SIZE_TYPE__ x, int y[(__UINTPTR_TYPE__)(int (*)[*])x]);	/* { dg-warning "not in a declaration" } */
+void foo11b(size_t x, int y[__extension__ (__UINTPTR_TYPE__)(int (*)[*])x]);	/* { dg-warning "not in a declaration" } */
 void foo11c(struct s { int (*x)[*]; } *y);	/* { dg-error "a member of a structure or union cannot have a variably modified type" "variably modified" } */
 /* { dg-warning "'struct s' declared inside parameter list" "struct decl" { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/vla-9.c b/gcc/testsuite/gcc.dg/vla-9.c
index 506a1a2..44a232b 100644
--- a/gcc/testsuite/gcc.dg/vla-9.c
+++ b/gcc/testsuite/gcc.dg/vla-9.c
@@ -2,7 +2,9 @@
 /* { dg-options "-std=c99 -pedantic-errors -W -Wall" } */
 /* PR c/28280 */
 
-void f(__SIZE_TYPE__ d)
+__extension__ typedef __SIZE_TYPE__ size_t;
+
+void f(size_t d)
 {
   typedef int t[d];
   t *g = (__typeof (g)) d;

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/7][v2][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf
  2018-11-21 20:42     ` Jozef Lawrynowicz
@ 2018-11-26 23:43       ` Jeff Law
  0 siblings, 0 replies; 34+ messages in thread
From: Jeff Law @ 2018-11-26 23:43 UTC (permalink / raw)
  To: Jozef Lawrynowicz, Rainer Orth; +Cc: GCC Patches, Nick Clifton, Paul Koning

On 11/21/18 1:42 PM, Jozef Lawrynowicz wrote:
> On Wed, 21 Nov 2018 20:19:29 +0100
> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
> 
>> new effective-target keywords always need documenting in
>> gcc/doc/sourcebuild.texi.
>>
>> 	Rainer
>>
> Whoops, thanks for the heads up, fixed in attached.
> 
> I'll add documentation for the keywords added in the other patches as well.
> 
> Jozef
> 
> 
> 0001-TESTSUITE-MSP430-Tweak-dg-directives-for-msp430-elf.patch
> 
> From be96391838c65b297589ac47ad6347f55ea713c0 Mon Sep 17 00:00:00 2001
> From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
> Date: Thu, 8 Nov 2018 18:55:57 +0000
> Subject: [PATCH] [TESTSUITE][MSP430] Tweak dg-directives for msp430-elf
> 
> 2018-11-21  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
> 
> 	gcc/ChangeLog:
> 
> 	* doc/sourcebuild.texi: Document check_effective_target_int_eq_float
> 	and check_effective_target_ptr_eq_long.
> 
> 	gcc/testsuite/ChangeLog:
> 
> 	* lib/target-supports.exp
> 	(check_effective_target_logical_op_short_circuit): Add msp430.
> 	(check_effective_target_int_eq_float): New. 
> 	(check_effective_target_ptr_eq_long): New. 
> 	* c-c++-common/pr41779.c: Require int_eq_float for dg-warning tests.
> 	* c-c++-common/pr57371-2.c: XFAIL optimized dump scan when
> 	sizeof (float) != sizeof (int).
> 	* gcc.dg/pr84670-4.c: Require ptr_eq_long.
> 	* gcc.dg/pr85859.c: Likewise.
> 	* gcc.dg/Wno-frame-address.c: Skip for msp430-elf.
> 	* gcc.dg/torture/stackalign/builtin-apply-2.c: Likewise.
> 	* gcc.dg/ifcvt-4.c: Likewise.
> 	* gcc.dg/pr34856.c: Likewise.
> 	* gcc.dg/builtin-apply2.c: Likewise.
> 	* gcc.dg/tree-ssa/ssa-dse-26.c: Likewise.
> 	* gcc.dg/attr-alloc_size-11.c: Remove dg-warning XFAIL for msp430.
> 	* gcc.dg/tree-ssa/20040204-1.c: Likewise.
> 	* gcc.dg/compat/struct-by-value-16a_x.c: Build at -O1 for msp430
> 	so it fits.
> 	* gcc.dg/lto/20091013-1_0.c: Require ptr_eq_long.
> 	* gcc.dg/lto/20091013-1_1.c: Remove xfail-if for when
> 	sizeof(void *) != sizeof(long).
> 	* gcc.dg/lto/20091013-1_2.c: Likewise.
> 	* gcc.dg/tree-ssa/loop-1.c: Fix expected dg-final behaviour for msp430.
> 	* gcc.dg/tree-ssa/gen-vect-25.c: Likewise.
> 	* gcc.dg/tree-ssa/gen-vect-11.c: Likewise.
> 	* gcc.dg/tree-ssa/loop-35.c: Likewise.
> 	* gcc.dg/tree-ssa/pr23455.c: Likewise.
> 	* gcc.dg/weak/typeof-2.c: Likewise.
> 	* gcc.target/msp430/interrupt_fn_placement.c: Skip for 430 ISA.
> 	* gcc.target/msp430/pr78818-data-region.c: Fix scan-assembler text.
> 	* gcc.target/msp430/pr79242.c: Don't skip for -msmall.
> 	* gcc.target/msp430/special-regs.c: Use "__asm__" instead of "asm".
OK
jeff

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 5/7][MSP430][TESTSUITE] Prune messages about ISO C not supporting __int20 from output of tests
  2018-11-26 23:07     ` Jozef Lawrynowicz
@ 2018-11-27 18:50       ` Mike Stump
  2018-11-28 11:03         ` Jozef Lawrynowicz
  0 siblings, 1 reply; 34+ messages in thread
From: Mike Stump @ 2018-11-27 18:50 UTC (permalink / raw)
  To: Jozef Lawrynowicz; +Cc: GCC Patches, Nick Clifton

On Nov 26, 2018, at 3:07 PM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> 
> On Mon, 26 Nov 2018 12:51:26 -0800
> Mike Stump <mikestump@comcast.net> wrote:
> 
>> On Nov 14, 2018, at 7:56 AM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
>>> 
>>> Patch 5 deals with ISO C errors emitted by tests when the large memory model is
>>> used. size_t and ptrdiff_t are __int20 with -mlarge, and if the test is
>>> compiled with -pedantic-errors and -std=* or -ansi, then use of these types
>>> causes an error of the form:
>>> ISO C does not support __int20 types
>>> I fixed this by adding dg-prune-output directives to tests which cause this
>>> error.  
>> 
>> So, it is important that standard code not produce errors.  Kinda fundamental.
>> 
>> I think this should be fixed in some other way.  If a type is to be used as a standard type, producing an error for that type's use is wrong.  Instead, find a way (cough, __extension__), to mark or not warn (error) for it instead.
> 
> Thanks for the feedback.
> 
>> Can you fix __SIZE_TYPE__ itself to have __extension__ in it?  If not, then I'd find another way to remove that warning for the type.
> 
> It appears you can actually add __extension__ everywhere (that I tried), except
> for the argument types in the declaration of a function i.e.
> 	foo (__extension__ __SIZE_TYPE__ a)
> doesn't work.

Ouch.  Seems like a bug in the parsers.  Could you file a bug report for this against C and C++.  Once that bug is fixed, then you can just add __extension__ to SIZE_TYPE in your port file.

> So I added __extension__ where possible, and in a couple of other cases I
> instead typedef'd with __extension__.

> Ok for trunk?

No.  I mean, __extension__ should be added in SIZE_TYPE in your port.h file.  That, or, you need a type that won't complain when used.

Recall, you're not doing the port for the testsuite, you're doing the port for users.  Users don't want a ton of warnings or errors when compiling trivial standard code.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 5/7][MSP430][TESTSUITE] Prune messages about ISO C not supporting __int20 from output of tests
  2018-11-27 18:50       ` Mike Stump
@ 2018-11-28 11:03         ` Jozef Lawrynowicz
  0 siblings, 0 replies; 34+ messages in thread
From: Jozef Lawrynowicz @ 2018-11-28 11:03 UTC (permalink / raw)
  To: Mike Stump; +Cc: GCC Patches, Nick Clifton

On Tue, 27 Nov 2018 10:49:56 -0800
Mike Stump <mikestump@comcast.net> wrote:

> On Nov 26, 2018, at 3:07 PM, Jozef Lawrynowicz <jozef.l@mittosystems.com> wrote:
> > 
> > It appears you can actually add __extension__ everywhere (that I tried), except
> > for the argument types in the declaration of a function i.e.
> > 	foo (__extension__ __SIZE_TYPE__ a)
> > doesn't work.  
> 
> Ouch.  Seems like a bug in the parsers.  Could you file a bug report for this against C and C++.  Once that bug is fixed, then you can just add __extension__ to SIZE_TYPE in your port file.

Filed PR88237.

> 
> > So I added __extension__ where possible, and in a couple of other cases I
> > instead typedef'd with __extension__.  
> 
> > Ok for trunk?  
> 
> No.  I mean, __extension__ should be added in SIZE_TYPE in your port.h file.  That, or, you need a type that won't complain when used.
> 
> Recall, you're not doing the port for the testsuite, you're doing the port for users.  Users don't want a ton of warnings or errors when compiling trivial standard code.

Apologies, I made a mistake in the wording of my initial submission.

intptr_t, size_t and ptrdiff_t do NOT cause errors, despite the base type
being __int20.
__INTPTR_TYPE__, __SIZE_TYPE__ and __PTRDIFF_TYPE__ DO cause the ISO C errors,
as these are just macros which will expand to __int20 after
pre-processing.

The documentation says users should not use these __*_TYPE__ macros
directly (cpp.texi):
> You should not use these macros directly; instead, include the
> appropriate headers and use the typedefs.

Given that the errors only occur when using macros which expand to __int20,
would you agree that the current behaviour of the compiler is correct?

Thanks,
Jozef

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2018-11-28 11:03 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 15:41 [PATCH 0/7][MSP430][TESTSUITE] Fix GCC tests for msp430-elf Jozef Lawrynowicz
2018-11-14 15:44 ` [PATCH 1/7][MSP430][TESTSUITE] Tweak dg-directives " Jozef Lawrynowicz
2018-11-14 16:31   ` Paul Koning
2018-11-14 22:20     ` Jozef Lawrynowicz
2018-11-15 14:48       ` Paul Koning
2018-11-15 17:49         ` Jozef Lawrynowicz
2018-11-14 16:54   ` Andreas Schwab
2018-11-14 18:00     ` Jozef Lawrynowicz
2018-11-14 18:50       ` Paul Koning
2018-11-14 19:29         ` Jozef Lawrynowicz
2018-11-15  9:37       ` Andreas Schwab
2018-11-15 12:09         ` Jozef Lawrynowicz
2018-11-14 15:47 ` [PATCH 2/7][MSP430][TESTSUITE] Add path to libssp to the linker search path when checking for -fstack-protector support Jozef Lawrynowicz
2018-11-14 15:49 ` [PATCH 3/7][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays Jozef Lawrynowicz
2018-11-26 20:16   ` Mike Stump
2018-11-14 15:52 ` [PATCH 4/7][MSP430][TESTSUITE] Fix tests when int is 16-bit by default Jozef Lawrynowicz
2018-11-26 20:39   ` Mike Stump
2018-11-14 15:56 ` [PATCH 5/7][MSP430][TESTSUITE] Prune messages about ISO C not supporting __int20 from output of tests Jozef Lawrynowicz
2018-11-26 20:51   ` Mike Stump
2018-11-26 23:07     ` Jozef Lawrynowicz
2018-11-27 18:50       ` Mike Stump
2018-11-28 11:03         ` Jozef Lawrynowicz
2018-11-14 15:58 ` [PATCH 6/7][MSP430][TESTSUITE] Fix tests requiring float printf support when GCC was configured with --enable-newlib-nano-formatted-io Jozef Lawrynowicz
2018-11-26 20:26   ` Mike Stump
2018-11-14 15:59 ` [PATCH 7/7][MSP430][TESTSUITE] Fix tests for msp430-elf large memory model Jozef Lawrynowicz
2018-11-21 19:05 ` [PATCH 1/7][v2][MSP430][TESTSUITE] Tweak dg-directives for msp430-elf Jozef Lawrynowicz
2018-11-21 19:19   ` Rainer Orth
2018-11-21 20:42     ` Jozef Lawrynowicz
2018-11-26 23:43       ` Jeff Law
2018-11-21 22:39 ` [PATCH 3/7][v2][MSP430][TESTSUITE] Dynamically check if size_t is large enough for tests containing large structs/arrays Jozef Lawrynowicz
2018-11-26 20:20   ` Mike Stump
2018-11-26 21:28     ` Jozef Lawrynowicz
2018-11-21 22:41 ` [PATCH 6/7][v2][MSP430][TESTSUITE] Fix tests requiring float printf support when GCC was configured with --enable-newlib-nano-formatted-io Jozef Lawrynowicz
2018-11-21 22:44 ` [PATCH 7/7][v2][MSP430][TESTSUITE] Fix tests for msp430-elf large memory model Jozef Lawrynowicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).