From patchwork Fri Feb 18 23:41:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 83666 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 8EB58B711E for ; Sat, 19 Feb 2011 10:41:44 +1100 (EST) Received: (qmail 20042 invoked by alias); 18 Feb 2011 23:41:43 -0000 Received: (qmail 20034 invoked by uid 22791); 18 Feb 2011 23:41:38 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_CP, TW_FG, TW_TC, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Feb 2011 23:41:27 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1INfQ1n031185 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 18 Feb 2011 18:41:26 -0500 Received: from greed.delorie.com ([10.3.112.14]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p1INfO0T000754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 18 Feb 2011 18:41:25 -0500 Received: from greed.delorie.com (localhost.localdomain [127.0.0.1]) by greed.delorie.com (8.14.4/8.14.4) with ESMTP id p1INfNHe013025 for ; Fri, 18 Feb 2011 18:41:23 -0500 Received: (from dj@localhost) by greed.delorie.com (8.14.4/8.14.4/Submit) id p1INfM8k013024; Fri, 18 Feb 2011 18:41:22 -0500 Date: Fri, 18 Feb 2011 18:41:22 -0500 Message-Id: <201102182341.p1INfM8k013024@greed.delorie.com> From: DJ Delorie To: gcc-patches@gcc.gnu.org Subject: [testsuite] fix invalid ilp32 assumptions and m32c-isms X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Mostly just adding effective-target filters as appropriate, a few m32c-specific fixes. The rest are corrections to make the code work properly on 16-bit systems, and some m32c filters. m32c has two pointer sizes, 16bit for r8c/m16c, and 24bit for m32cm/m32c, but both have 16bit int and size_t. Do these changes look reasonable? I'm not sure I used the right method on some of them. Index: gcc.c-torture/execute/cmpsi-2.c =================================================================== --- gcc.c-torture/execute/cmpsi-2.c (revision 170291) +++ gcc.c-torture/execute/cmpsi-2.c (working copy) @@ -1,102 +1,108 @@ #define F 140 #define T 13 -feq (int x, int y) +#if defined(__m32c__) +#define SItype long +#else +#define SItype int +#endif + +feq (SItype x, SItype y) { if (x == y) return T; else return F; } -fne (int x, int y) +fne (SItype x, SItype y) { if (x != y) return T; else return F; } -flt (int x, int y) +flt (SItype x, SItype y) { if (x < y) return T; else return F; } -fge (int x, int y) +fge (SItype x, SItype y) { if (x >= y) return T; else return F; } -fgt (int x, int y) +fgt (SItype x, SItype y) { if (x > y) return T; else return F; } -fle (int x, int y) +fle (SItype x, SItype y) { if (x <= y) return T; else return F; } -fltu (unsigned int x, unsigned int y) +fltu (unsigned SItype x, unsigned SItype y) { if (x < y) return T; else return F; } -fgeu (unsigned int x, unsigned int y) +fgeu (unsigned SItype x, unsigned SItype y) { if (x >= y) return T; else return F; } -fgtu (unsigned int x, unsigned int y) +fgtu (unsigned SItype x, unsigned SItype y) { if (x > y) return T; else return F; } -fleu (unsigned int x, unsigned int y) +fleu (unsigned SItype x, unsigned SItype y) { if (x <= y) return T; else return F; } -unsigned int args[] = +unsigned SItype args[] = { 0L, 1L, -1L, 0x7fffffffL, 0x80000000L, 0x80000001L, 0x1A3F2373L, 0x93850E92L }; -int correct_results[] = +SItype correct_results[] = { T, F, F, T, F, T, F, T, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, F, T, T, F, F, T, T, F, F, T, F, T, F, T, T, F, T, F, F, T, @@ -158,23 +164,23 @@ int correct_results[] = F, T, F, T, T, F, F, T, T, F, F, T, F, T, T, F, F, T, T, F, F, T, T, F, F, T, F, T, T, F, T, F, F, T, F, T, F, T, F, T }; -int +SItype main (void) { - int i, j, *res = correct_results; + SItype i, j, *res = correct_results; for (i = 0; i < 8; i++) { - unsigned int arg0 = args[i]; + unsigned SItype arg0 = args[i]; for (j = 0; j < 8; j++) { - unsigned int arg1 = args[j]; + unsigned SItype arg1 = args[j]; if (feq (arg0, arg1) != *res++) abort (); if (fne (arg0, arg1) != *res++) abort (); if (flt (arg0, arg1) != *res++) Index: gcc.c-torture/execute/nestfunc-3.c =================================================================== --- gcc.c-torture/execute/nestfunc-3.c (revision 170291) +++ gcc.c-torture/execute/nestfunc-3.c (working copy) @@ -37,13 +37,13 @@ main (void) for (k = 0; k < 10; ++k) sum += foo (i, j > k ? j - k : k - j, nested_2); } } - if ((sum & 0xffffffff) != 0xbecfcbf5) + if (((unsigned long)sum & 0xffffffffUL) != 0xbecfcbf5UL) abort (); #endif exit (0); } Index: gcc.c-torture/execute/ieee/20041213-1.c =================================================================== --- gcc.c-torture/execute/ieee/20041213-1.c (revision 170291) +++ gcc.c-torture/execute/ieee/20041213-1.c (working copy) @@ -9,9 +9,12 @@ double foo (void) return 0.0 / 0.0; } double x; int main (void) { + /* m32c does not have sqrt */ +#if !defined(__m32c__) x = sqrt (foo ()); +#endif return 0; } Index: gcc.c-torture/execute/980709-1.x =================================================================== --- gcc.c-torture/execute/980709-1.x (revision 170291) +++ gcc.c-torture/execute/980709-1.x (working copy) @@ -1,10 +1,14 @@ # pow() is not available on m6811/m6812 target, this test will not link. if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"]} { return 1 } +# pow() is not available on m32c target, this test will not link. +if { [istarget "m32c-*-*"]} { + return 1 +} # XFAIL this test for AIX using -msoft-float. # This test calls the system libm.a function pow. # A false failure is reported if -msoft-float is used. # AIX expects the the parameters to be passed in fp regs. if { [istarget powerpc-*-aix*] || [istarget rs6000-*-aix*] } { set torture_eval_before_execute { Index: gcc.c-torture/execute/20101011-1.c =================================================================== --- gcc.c-torture/execute/20101011-1.c (revision 170291) +++ gcc.c-torture/execute/20101011-1.c (working copy) @@ -19,12 +19,15 @@ systems that use the Linux kernel. */ # define DO_TEST 0 #elif defined (__mips16) && defined(__linux__) /* Not all Linux kernels deal correctly the breakpoints generated by MIPS16 divisions by zero. They show up as a SIGTRAP instead. */ # define DO_TEST 0 +#elif defined (__m32c__) + /* On M32C division by zero does not trap. */ +# define DO_TEST 0 #else # define DO_TEST 1 #endif #if DO_TEST Index: gcc.c-torture/execute/vector-subscript-1.c =================================================================== --- gcc.c-torture/execute/vector-subscript-1.c (revision 170291) +++ gcc.c-torture/execute/vector-subscript-1.c (working copy) @@ -46,13 +46,13 @@ int main( int argc, char* argv[] ) __builtin_abort (); if (*f(&val3, 2 ) != 3) __builtin_abort (); if (*f(&val3, 3 ) != 4) __builtin_abort (); - __builtin_memcpy(a, &val3, 16); + __builtin_memcpy(a, &val3, sizeof(a)); for(i = 0; i < 4; i++) if (a[i] != i+1) __builtin_abort (); return 0; Index: gcc.c-torture/compile/pr43191.c =================================================================== --- gcc.c-torture/compile/pr43191.c (revision 170291) +++ gcc.c-torture/compile/pr43191.c (working copy) @@ -1,7 +1,8 @@ /* { dg-skip-if "Ints are 16 bits" { "pdp11-*-*" } { "*" } { "" } } */ +/* { dg-require-effective-target int32plus } */ struct S0 { }; struct S1 { Index: gcc.c-torture/compile/pr35318.c =================================================================== --- gcc.c-torture/compile/pr35318.c (revision 170291) +++ gcc.c-torture/compile/pr35318.c (working copy) @@ -1,7 +1,7 @@ -/* { dg-skip-if "" { pdp11-*-* } { "*" } { "" } } */ +/* { dg-skip-if "" { pdp11-*-* m32c-*-* } { "*" } { "" } } */ /* PR target/35318 */ void foo () { double x = 4, y; Index: gcc.c-torture/compile/20011114-1.c =================================================================== --- gcc.c-torture/compile/20011114-1.c (revision 170291) +++ gcc.c-torture/compile/20011114-1.c (working copy) @@ -1,2 +1,3 @@ +/* { dg-require-effective-target size32plus } */ extern void _text; static __SIZE_TYPE__ x = (__SIZE_TYPE__) &_text - 0x10000000L - 1; Index: gcc.c-torture/compile/pr41181.c =================================================================== --- gcc.c-torture/compile/pr41181.c (revision 170291) +++ gcc.c-torture/compile/pr41181.c (working copy) @@ -1,7 +1,7 @@ -/* { dg-skip-if "The array is too big" { "avr-*-*" "pdp11-*-*" } { "*" } { "" } } */ +/* { dg-skip-if "The array is too big" { "avr-*-*" "pdp11-*-*" "m32c-*-*" } { "*" } { "" } } */ char paths[1024]; static void x264_slicetype_path(char (*best_paths)[250], int n, int length) { __builtin_memcpy (best_paths[n], paths, length); } void x264_slicetype_analyse(int n, int length) Index: gcc.dg/cdce1.c =================================================================== --- gcc.dg/cdce1.c (revision 170291) +++ gcc.dg/cdce1.c (working copy) @@ -1,12 +1,13 @@ /* { dg-do run } */ /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */ /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details" { target *-*-netware* } } */ /* { dg-final { scan-tree-dump "cdce1.c:17: note: function call is shrink-wrapped into error conditions\." "cdce" } } */ /* { dg-final { cleanup-tree-dump "cdce" } } */ /* { dg-require-effective-target large_double } */ +/* { dg-require-effective-target int32plus } */ #include #include #include int total_err_count = 0; double foo_opt (int x, double y) __attribute__((noinline)); Index: gcc.dg/pr42629.c =================================================================== --- gcc.dg/pr42629.c (revision 170291) +++ gcc.dg/pr42629.c (working copy) @@ -1,10 +1,11 @@ /* This failed -fcompare-debug because register pressure computation took debug insns into account. */ /* { dg-do compile } */ /* { dg-options "-O1 -fsched-pressure -fschedule-insns -fcompare-debug" } */ +/* { dg-require-effective-target int32plus } */ int lzo_adler32(int adler, char *buf) { int s1 = adler; int s2 = adler; s1 += buf[0]; Index: gcc.dg/pr43402.c =================================================================== --- gcc.dg/pr43402.c (revision 170291) +++ gcc.dg/pr43402.c (working copy) @@ -25,13 +25,13 @@ getAlgorithmicTypeFromName(const char *r unsigned mid, start, limit; unsigned lastMid; int result; start = 0; limit = sizeof(cnvNameType)/sizeof(cnvNameType[0]); mid = limit; - lastMid = 0xffffffff; + lastMid = (unsigned)~0; for (;;) { mid = (start + limit) / 2; if (lastMid == mid) { /* Have we moved? */ break; /* We haven't moved, and it wasn't found. */ } Index: gcc.dg/pr34225.c =================================================================== --- gcc.dg/pr34225.c (revision 170291) +++ gcc.dg/pr34225.c (working copy) @@ -1,10 +1,11 @@ /* PR target/34225 */ /* { dg-do compile } */ /* { dg-options "-O2 -fno-strict-aliasing -fstack-protector" } */ /* { dg-require-effective-target fstack_protector } */ +/* { dg-require-effective-target size32plus } */ typedef __SIZE_TYPE__ size_t; extern int sscanf (const char *, const char *, ...); struct C { char c[240]; Index: gcc.dg/sibcall-3.c =================================================================== --- gcc.dg/sibcall-3.c (revision 170291) +++ gcc.dg/sibcall-3.c (working copy) @@ -2,13 +2,13 @@ void non-leaf-function taking one int argument calling a function which is about the same as itself. Copyright (C) 2002 Free Software Foundation Inc. Contributed by Hans-Peter Nilsson */ -/* { dg-do run { xfail { { arc-*-* avr-*-* cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* m68hc1?-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */ +/* { dg-do run { xfail { { arc-*-* avr-*-* cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32c-*-* m32r-*-* m68hc1?-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */ /* -mlongcall disables sibcall patterns. */ /* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */ /* { dg-options "-O2 -foptimize-sibling-calls" } */ /* The option -foptimize-sibling-calls is the default, but serves as marker. This test is xfailed on targets without sibcall patterns Index: gcc.dg/pr40971.c =================================================================== --- gcc.dg/pr40971.c (revision 170291) +++ gcc.dg/pr40971.c (working copy) @@ -1,10 +1,11 @@ /* PR target/40971 */ /* { dg-do compile } */ /* { dg-options "-O -fstack-protector -fno-strict-aliasing" } */ /* { dg-require-effective-target fstack_protector } */ +/* { dg-require-effective-target size32plus } */ extern void bar (char *); void foo (int f, long a) { Index: gcc.dg/pr44023.c =================================================================== --- gcc.dg/pr44023.c (revision 170291) +++ gcc.dg/pr44023.c (working copy) @@ -1,10 +1,11 @@ /* PR debug/44023 */ /* { dg-do compile } */ /* { dg-options "-fcompare-debug -O2" } */ /* { dg-options "-fcompare-debug -O2 -mcpu=ev67" { target alpha*-*-* } } */ +/* { dg-require-effective-target int32plus } */ void foo (unsigned f, long v, unsigned *w, unsigned a, unsigned b, unsigned e, unsigned c, unsigned d) { unsigned h = v / 4, x[16]; while (f < h) Index: gcc.dg/utf-cvt.c =================================================================== --- gcc.dg/utf-cvt.c (revision 170291) +++ gcc.dg/utf-cvt.c (working copy) @@ -1,10 +1,10 @@ /* Contributed by Kris Van Hees */ /* Test the char16_t and char32_t promotion rules. */ /* { dg-do compile } */ -/* { dg-excess-errors "short and int are 16bit" { target { "avr-*-*" } } } */ +/* { dg-excess-errors "short and int are 16bit" { target { "avr-*-*" "m32c-*-*" } } } */ /* { dg-options "-std=gnu99 -Wall -Wconversion -Wsign-conversion" } */ typedef __CHAR16_TYPE__ char16_t; typedef __CHAR32_TYPE__ char32_t; extern void f_c (char); Index: gcc.dg/graphite/pr46966.c =================================================================== --- gcc.dg/graphite/pr46966.c (revision 170291) +++ gcc.dg/graphite/pr46966.c (working copy) @@ -1,9 +1,10 @@ /* PR tree-optimization/46966 */ /* { dg-do compile } */ /* { dg-options "-O -floop-interchange -ffast-math -fno-tree-copy-prop -fno-tree-loop-im" } */ +/* { dg-require-effective-target size32plus } */ int a[1000][1000]; void foo () { int i, j; Index: gcc.dg/graphite/pr42221.c =================================================================== --- gcc.dg/graphite/pr42221.c (revision 170291) +++ gcc.dg/graphite/pr42221.c (working copy) @@ -1,7 +1,8 @@ /* { dg-options "-Os -fgraphite-identity" } */ +/* { dg-require-effective-target int32plus } */ static void b2w(unsigned int *out, const unsigned char *in, unsigned int len) { const unsigned char *bpend = in + len; for (; in != bpend; in += 4, ++out) { Index: gcc.dg/graphite/scop-22.c =================================================================== --- gcc.dg/graphite/scop-22.c (revision 170291) +++ gcc.dg/graphite/scop-22.c (working copy) @@ -1,6 +1,7 @@ +/* { dg-require-effective-target size32plus } */ double u[1782225]; void foo(int N, int *res) { int i; double a, b; Index: gcc.dg/graphite/scop-dsyrk.c =================================================================== --- gcc.dg/graphite/scop-dsyrk.c (revision 170291) +++ gcc.dg/graphite/scop-dsyrk.c (working copy) @@ -1,6 +1,7 @@ +/* { dg-require-effective-target size32plus } */ #define NMAX 3000 #define MEASURE_TIME 1 static double a[NMAX][NMAX], c[NMAX][NMAX]; void dsyrk(long N) Index: gcc.dg/graphite/pr46185.c =================================================================== --- gcc.dg/graphite/pr46185.c (revision 170291) +++ gcc.dg/graphite/pr46185.c (working copy) @@ -1,8 +1,9 @@ /* { dg-do run } */ /* { dg-options "-O2 -floop-interchange -ffast-math -fno-ipa-cp" } */ +/* { dg-require-effective-target size32plus } */ #define DEBUG 0 #if DEBUG #include #endif Index: gcc.dg/graphite/scop-0.c =================================================================== --- gcc.dg/graphite/scop-0.c (revision 170291) +++ gcc.dg/graphite/scop-0.c (working copy) @@ -1,6 +1,7 @@ +/* { dg-require-effective-target size32plus } */ int foo (void); void bar (void); int toto() { /* Scop 1. */ Index: gcc.dg/graphite/pr42205-1.c =================================================================== --- gcc.dg/graphite/pr42205-1.c (revision 170291) +++ gcc.dg/graphite/pr42205-1.c (working copy) @@ -1,7 +1,8 @@ /* { dg-options "-O1 -ffast-math -floop-interchange" } */ +/* { dg-require-effective-target int32plus } */ int adler32(int adler, char *buf, int n) { int sum = 0; do { adler += buf[0]; Index: gcc.dg/graphite/scop-sor.c =================================================================== --- gcc.dg/graphite/scop-sor.c (revision 170291) +++ gcc.dg/graphite/scop-sor.c (working copy) @@ -1,6 +1,7 @@ +/* { dg-require-effective-target size32plus } */ #define SIZE 10000 static double P[SIZE][SIZE]; void sor(int N1, int N2){ int i, j, k; Index: gcc.dg/graphite/scop-dsyr2k.c =================================================================== --- gcc.dg/graphite/scop-dsyr2k.c (revision 170291) +++ gcc.dg/graphite/scop-dsyr2k.c (working copy) @@ -1,6 +1,7 @@ +/* { dg-require-effective-target size32plus } */ #define NMAX 3000 static double a[NMAX][NMAX], b[NMAX][NMAX], c[NMAX][NMAX]; void dsyr2k(long N) { int i,j,k; Index: gcc.dg/graphite/scop-mvt.c =================================================================== --- gcc.dg/graphite/scop-mvt.c (revision 170291) +++ gcc.dg/graphite/scop-mvt.c (working copy) @@ -1,6 +1,7 @@ +/* { dg-require-effective-target size32plus } */ #define NMAX 2000 static double x1[NMAX], x2[NMAX], a[NMAX][NMAX], y_1[NMAX], y_2[NMAX]; void mvt(long N) { Index: gcc.dg/sibcall-4.c =================================================================== --- gcc.dg/sibcall-4.c (revision 170291) +++ gcc.dg/sibcall-4.c (working copy) @@ -2,13 +2,13 @@ void non-leaf-function taking no arguments calling a function which is about the same as itself. Copyright (C) 2002 Free Software Foundation Inc. Contributed by Hans-Peter Nilsson */ -/* { dg-do run { xfail { { arc-*-* avr-*-* cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* m68hc1?-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */ +/* { dg-do run { xfail { { arc-*-* avr-*-* cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32c-*-* m32r-*-* m68hc1?-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */ /* -mlongcall disables sibcall patterns. */ /* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */ /* { dg-options "-O2 -foptimize-sibling-calls" } */ /* The option -foptimize-sibling-calls is the default, but serves as marker. This test is xfailed on targets without sibcall patterns Index: gcc.dg/pr46212.c =================================================================== --- gcc.dg/pr46212.c (revision 170291) +++ gcc.dg/pr46212.c (working copy) @@ -1,10 +1,11 @@ /* PR rtl-optimization/46212 */ /* { dg-do compile } */ /* { dg-options "-O3 -funroll-loops" } */ /* { dg-options "-O3 -funroll-loops -march=i386" { target { { i686-*-* x86_64-*-* } && ilp32 } } } */ +/* { dg-require-effective-target int32plus } */ static inline unsigned foo (void *x) { unsigned y = *(volatile unsigned *) (x); return (y >> 24) | ((y >> 8) & 0xff00) | ((y & 0xff00) << 8) | (y << 24); Index: gcc.dg/c99-stdint-1.c =================================================================== --- gcc.dg/c99-stdint-1.c (revision 170291) +++ gcc.dg/c99-stdint-1.c (working copy) @@ -211,13 +211,13 @@ test_max (void) CHECK_UNSIGNED_LIMITS(uintmax_t, UINTMAX_MAX); } void test_misc_limits (void) { -/* { dg-bogus "size" "ptrdiff is 16bits" { xfail avr-*-* } 218 } */ +/* { dg-bogus "size" "ptrdiff is 16bits" { xfail avr-*-* m32c-*-* } 218 } */ CHECK_SIGNED_LIMITS_2(__PTRDIFF_TYPE__, PTRDIFF_MIN, PTRDIFF_MAX, -65535L, 65535L); #ifndef SIGNAL_SUPPRESS CHECK_LIMITS_2(sig_atomic_t, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX, -127, 127, 255); #endif CHECK_UNSIGNED_LIMITS_2(__SIZE_TYPE__, SIZE_MAX, 65535U); CHECK_LIMITS_2(__WCHAR_TYPE__, WCHAR_MIN, WCHAR_MAX, -127, 127, 255); Index: gcc.dg/lto/20091013-1_1.c =================================================================== --- gcc.dg/lto/20091013-1_1.c (revision 170291) +++ gcc.dg/lto/20091013-1_1.c (working copy) @@ -61,21 +61,26 @@ static const struct gdi_obj_funcs font_f HFONT CreateFontIndirectW( const void *plf ) { return alloc_gdi_handle( 0, 6, &font_funcs ); } +#if defined(__r8c_cpu__) || defined (__m16c_cpu__) +#define P_INT unsigned int +#else +#define P_INT unsigned long +#endif static void update_font_code_page( DC *dc ) { CHARSETINFO csi; int charset = (unsigned char)1; if (dc->gdiFont) charset = WineEngGetTextCharsetInfo( dc->gdiFont, ((void *)0), 0 ); - if (TranslateCharsetInfo( ((void *)(unsigned long)((unsigned long)charset)), &csi, 1) ) + if (TranslateCharsetInfo( ((void *)(P_INT)((P_INT)charset)), &csi, 1) ) dc->font_code_page = csi.ciACP; else { switch(charset) { case (unsigned char)1: dc->font_code_page = GetACP(); break; Index: gcc.dg/lto/20090218-2_1.c =================================================================== --- gcc.dg/lto/20090218-2_1.c (revision 170291) +++ gcc.dg/lto/20090218-2_1.c (working copy) @@ -1,14 +1,19 @@ typedef struct { } mem_attrs; int main(void) { return 0; } -void *malloc(unsigned long size); -void *memcpy(void *dest, const void *src, unsigned long n); +#if defined(__m32c__) +#define SIZE_T unsigned int +#else +#define SIZE_T unsigned long +#endif +void *malloc(SIZE_T size); +void *memcpy(void *dest, const void *src, SIZE_T n); static mem_attrs * get_mem_attrs () { void **slot; *slot = malloc (3); memcpy (*slot, 0, 3); } void set_mem_attributes () { Index: gcc.dg/lto/20091013-1_2.c =================================================================== --- gcc.dg/lto/20091013-1_2.c (revision 170291) +++ gcc.dg/lto/20091013-1_2.c (working copy) @@ -1,6 +1,8 @@ +/* { dg-require-effective-target int32plus } */ +/* { dg-require-effective-target ptr32plus } */ typedef struct HDC__ { int unused; } *HDC; typedef struct HFONT__ { int unused; } *HFONT; void* HeapAlloc(void*,unsigned int,unsigned long); typedef struct tagLOGFONTW Index: gcc.dg/lto/20110201-1_0.c =================================================================== --- gcc.dg/lto/20110201-1_0.c (revision 170291) +++ gcc.dg/lto/20110201-1_0.c (working copy) @@ -1,10 +1,11 @@ /* { dg-lto-do run } */ /* { dg-lto-options { { -O0 -flto } } } */ /* { dg-extra-ld-options "-O2 -ffast-math -fuse-linker-plugin" } */ /* { dg-require-linker-plugin "" } */ +/* { dg-skip-if "no sqrt" { "m32c-*-*" } { "*" } { "" } } */ /* We require a linker plugin because otherwise we'd need to link against libm which we are not sure here has cabs on all targets. This is because collect2 invokes ld on the -O0 object code which does not have folded cabs. */ Index: gcc.dg/torture/pr43165.c =================================================================== --- gcc.dg/torture/pr43165.c (revision 170291) +++ gcc.dg/torture/pr43165.c (working copy) @@ -1,8 +1,9 @@ /* PR debug/43165 */ /* { dg-options "-g" } */ +/* { dg-require-effective-target int32plus } */ struct __attribute__((packed)) S { unsigned char a; unsigned short b; unsigned short c; Index: gcc.dg/torture/pr47228.c =================================================================== --- gcc.dg/torture/pr47228.c (revision 170291) +++ gcc.dg/torture/pr47228.c (working copy) @@ -1,7 +1,8 @@ /* { dg-do run } */ +/* { dg-require-effective-target int32plus } */ struct S4 { unsigned f0:24; } __attribute__((__packed__)); Index: gcc.dg/torture/stackalign/non-local-goto-5.c =================================================================== --- gcc.dg/torture/stackalign/non-local-goto-5.c (revision 170291) +++ gcc.dg/torture/stackalign/non-local-goto-5.c (working copy) @@ -1,11 +1,11 @@ /* { dg-do run } */ +extern void exit (int); #if !defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) extern void abort (void); -extern void exit (int); int s(i){if(i>0){__label__ l1;int f(int i){if(i==2)goto l1;return 0;}return f(i);l1:;}return 1;} int x(){return s(0)==1&&s(1)==0&&s(2)==1;} int main(){if(x()!=1)abort();exit(0);} #else int main(){ exit (0); } #endif Index: gcc.dg/tree-ssa/pr23455.c =================================================================== --- gcc.dg/tree-ssa/pr23455.c (revision 170291) +++ gcc.dg/tree-ssa/pr23455.c (working copy) @@ -16,9 +16,9 @@ bi_windup(unsigned int *outbuf, unsigned unsigned long t3 = outcnt; outbuf[t3] = 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-*-* m32c-*-*" } } } } */ +/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "pre" {target { avr-*-* m32c-*-* } } } } */ /* { dg-final { cleanup-tree-dump "pre" } } */ Index: gcc.dg/tree-ssa/vrp47.c =================================================================== --- gcc.dg/tree-ssa/vrp47.c (revision 170291) +++ gcc.dg/tree-ssa/vrp47.c (working copy) @@ -1,12 +1,12 @@ /* Skip on MIPS, where LOGICAL_OP_NON_SHORT_CIRCUIT inhibits the setcc optimizations that expose the VRP opportunity. */ /* Skip on S/390 and avr. Lower values in BRANCH_COST lead to two conditional jumps when evaluating an && condition. VRP is not able to optimize this. */ -/* { dg-do compile { target { ! "mips*-*-* s390*-*-* avr-*-* mn10300-*-*" } } } */ +/* { dg-do compile { target { ! "mips*-*-* s390*-*-* avr-*-* m32c-*-* mn10300-*-*" } } } */ /* { dg-options "-O2 -fdump-tree-vrp -fdump-tree-dom" } */ /* { dg-options "-O2 -fdump-tree-vrp -fdump-tree-dom -march=i586" { target { i?86-*-* && ilp32 } } } */ int h(int x, int y) { if ((x >= 0 && x <= 1) && (y >= 0 && y <= 1)) Index: gcc.dg/tree-ssa/pr45144.c =================================================================== --- gcc.dg/tree-ssa/pr45144.c (revision 170291) +++ gcc.dg/tree-ssa/pr45144.c (working copy) @@ -1,8 +1,9 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-require-effective-target int32plus } */ void baz (unsigned); extern unsigned buf[]; struct A Index: gcc.dg/tree-ssa/gen-vect-11.c =================================================================== --- gcc.dg/tree-ssa/gen-vect-11.c (revision 170291) +++ gcc.dg/tree-ssa/gen-vect-11.c (working copy) @@ -27,8 +27,8 @@ int main () } return 0; } -/* { 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-*-* m32c-*-*" } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: gcc.dg/tree-ssa/loop-35.c =================================================================== --- gcc.dg/tree-ssa/loop-35.c (revision 170291) +++ gcc.dg/tree-ssa/loop-35.c (working copy) @@ -57,9 +57,9 @@ void test4(struct a *A, unsigned long b) { A[b].X += i; A[b+1].Y += i; } } /* long index not hoisted for avr target PR 36561 */ -/* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim1" { xfail { "avr-*-*" } } } } */ -/* { dg-final { scan-tree-dump-times "Executing store motion of" 6 "lim1" { target { "avr-*-*" } } } } */ +/* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim1" { xfail { "avr-*-*" "m32c-*-*" } } } } */ +/* { dg-final { scan-tree-dump-times "Executing store motion of" 6 "lim1" { target { "avr-*-*" "m32c-*-*" } } } } */ /* { dg-final { cleanup-tree-dump "lim\[1-2\]" } } */ Index: gcc.dg/tree-ssa/ssa-fre-26.c =================================================================== --- gcc.dg/tree-ssa/ssa-fre-26.c (revision 170291) +++ gcc.dg/tree-ssa/ssa-fre-26.c (working copy) @@ -12,8 +12,8 @@ int foo (union U *p) p->f = 0.0; u = *p; return u.i; } /* avr has 16 bit int and 32 bit float */ -/* { dg-final { scan-tree-dump "Replaced u.i with 0 in" "fre" {xfail avr-*-* } } } */ +/* { dg-final { scan-tree-dump "Replaced u.i with 0 in" "fre" {xfail avr-*-* m32c-*-* } } } */ /* { dg-final { cleanup-tree-dump "fre" } } */ Index: gcc.dg/tree-ssa/ssa-ccp-33.c =================================================================== --- gcc.dg/tree-ssa/ssa-ccp-33.c (revision 170291) +++ gcc.dg/tree-ssa/ssa-ccp-33.c (working copy) @@ -1,8 +1,9 @@ /* { dg-do link } */ /* { dg-options "-O" } */ +/* { dg-skip-if "pointers are bigger than size_t" { "m32c-*-*" } { "-mcpu=m32c" "-mcpu=m32cm" } { "" } } */ extern void link_error (); int a[256]; void foo(int n) { int *p; Index: gcc.dg/tree-ssa/pr42585.c =================================================================== --- gcc.dg/tree-ssa/pr42585.c (revision 170291) +++ gcc.dg/tree-ssa/pr42585.c (working copy) @@ -32,9 +32,9 @@ Cyc_string_ungetc (int ignore, struct _f } /* The local aggregates . */ /* Whether the structs are totally scalarized or not depends on the MOVE_RATIO macro defintion in the back end. The scalarization will not take place when using small values for MOVE_RATIO. */ -/* { dg-final { scan-tree-dump-times "struct _fat_ptr _ans" 0 "optimized" { target { ! "powerpc*-*-* arm-*-* sh*-*-* s390*-*-*" } } } } */ -/* { dg-final { scan-tree-dump-times "struct _fat_ptr _T2" 0 "optimized" { target { ! "powerpc*-*-* arm-*-* sh*-*-* s390*-*-*" } } } } */ +/* { dg-final { scan-tree-dump-times "struct _fat_ptr _ans" 0 "optimized" { target { ! "powerpc*-*-* arm-*-* sh*-*-* s390*-*-* m32c-*-*" } } } } */ +/* { dg-final { scan-tree-dump-times "struct _fat_ptr _T2" 0 "optimized" { target { ! "powerpc*-*-* arm-*-* sh*-*-* s390*-*-* m32c-*-*" } } } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ Index: gcc.dg/tree-ssa/gen-vect-25.c =================================================================== --- gcc.dg/tree-ssa/gen-vect-25.c (revision 170291) +++ gcc.dg/tree-ssa/gen-vect-25.c (working copy) @@ -51,9 +51,9 @@ static volatile int n = 1; 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 "vectorized 2 loops" 1 "vect" { target { ! "avr-*-* m32c-*-*" } } } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! avr-*-* } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: gcc.dg/tree-ssa/vrp51.c =================================================================== --- gcc.dg/tree-ssa/vrp51.c (revision 170291) +++ gcc.dg/tree-ssa/vrp51.c (working copy) @@ -1,9 +1,10 @@ /* PR tree-optimization/28632 */ /* { dg-do compile } */ /* { dg-options "-O2 -ftree-vrp" } */ +/* { dg-require-effective-target int32plus } */ void v4 (unsigned a, unsigned b) { if (a < 0x1000) return; if (a > 0x1000) return; Index: gcc.dg/pr31490.c =================================================================== --- gcc.dg/pr31490.c (revision 170291) +++ gcc.dg/pr31490.c (working copy) @@ -1,6 +1,13 @@ /* PR middle-end/31490 */ /* { dg-do compile } */ /* { dg-require-named-sections "" } */ + +#if defined (__r8c_cpu__) || defined (__m16c_cpu__) +#define PTRLONG int +#else +#define PTRLONG long +#endif + int cpu (void *attr) {} -const unsigned long x __attribute__((section("foo"))) = (unsigned long)&cpu; -const unsigned long g __attribute__((section("foo"))) = 0; +const unsigned PTRLONG x __attribute__((section("foo"))) = (unsigned PTRLONG)&cpu; +const unsigned PTRLONG g __attribute__((section("foo"))) = 0; Index: gcc.dg/ipa/pr45644.c =================================================================== --- gcc.dg/ipa/pr45644.c (revision 170291) +++ gcc.dg/ipa/pr45644.c (working copy) @@ -1,9 +1,10 @@ /* Verify that we do not IPA-SRA bitfields. */ /* { dg-do run } */ /* { dg-options "-O2" } */ +/* { dg-require-effective-target int32plus } */ extern void abort (void); struct S { int j : 8; Index: gcc.dg/c99-stdint-2.c =================================================================== --- gcc.dg/c99-stdint-2.c (revision 170291) +++ gcc.dg/c99-stdint-2.c (working copy) @@ -1,8 +1,8 @@ /* Verify that is present and follows the C99 requirements. Freestanding version. */ /* { dg-do compile } */ /* { dg-options "-std=iso9899:1999 -pedantic-errors -ffreestanding" } */ -/* { dg-xfail-if "ptrdiff size is 16bits" { avr-*-* } } */ +/* { dg-xfail-if "ptrdiff size is 16bits" { avr-*-* m32c-*-* } } */ /* The test is that there are no diagnostics, so just include the hosted version. */ #include "c99-stdint-1.c" Index: c-c++-common/pr44832.c =================================================================== --- c-c++-common/pr44832.c (revision 170291) +++ c-c++-common/pr44832.c (working copy) @@ -1,10 +1,11 @@ /* PR debug/44832 */ /* { dg-do compile } */ /* { dg-options "-O2 -fcompare-debug" } */ /* { dg-options "-O2 -fcompare-debug -fno-short-enums" {target short_enums} } */ +/* { dg-require-effective-target int32plus } */ struct rtx_def; typedef struct rtx_def *rtx; typedef const struct rtx_def *const_rtx; struct rtvec_def; typedef struct rtvec_def *rtvec;