This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: gcc.c-torture/execute/pr22098-1.c
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 18 Nov 2008 17:23:18 -0500
- Subject: Re: gcc.c-torture/execute/pr22098-1.c
- References: <200811182216.mAIMGheo025783@greed.delorie.com>
On Tue, Nov 18, 2008 at 05:16:43PM -0500, DJ Delorie wrote:
>
> sizeof(size_t) < sizeof(int *) on m32c (at least, on the larger
> chips) so this test can't work. Ok?
>
> * gcc.c-torture/execute/pr22098-1.x: New.
>
> +++ gcc/testsuite/gcc.c-torture/execute/pr22098-1.x
>
> # m32c pointers are 24 bits, but size_t is only 16.
> if { [istarget "m32c-*-*"] } {
> return 1
> }
>
> return 0
There might be other ports in the future with this property (which is allowed
by the ISO C standard, for example segmented pointers on 286 systems in the
past had size_t smaller than pointers). It might be more correct to add
instead:
if (sizeof (size_t) != sizeof (int *))
return 0;
before the assignment to b.
--
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com