This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc.c-torture/execute/pr22098-1.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]