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: proposed new dg-effective-target(s) for >= 32 bits


On Tue, Mar 28, 2006 at 08:19:30PM -0500, DJ Delorie wrote:
> 
> There are a number of test cases that assume sizeof(int) is *at least*
> 32 bits, and fail for 16 bit integers.  Same for small pointers or
> small size_t.  One catch-all test would be to see if a target is
> "ilp32" *or greater*:
> 
> # Return 1 if we're generating 32-bit or larger code using default
> # options, 0 otherwise.
> 
> proc check_effective_target_ilp32plus { } {
>     return [check_no_compiler_messages ilp32plus object {
> 	int dummy[sizeof (int) >= 4
> 		  && sizeof (void *) >= 4
> 		  && sizeof (long) >= 4 ? 1 : -1];
>     }]
> }
> 
> For more granularity, perhaps a set of tests:
> 
> 	int32p	integers are 32 bits or more
> 	long32p	longs ...
> 	size32p	size_t ...
> 	ptr32p	pointers ...
> 
> I include "size_t" here because m32c, for example, has
> sizeof(pointer)==4 but, really, it's only 24 bits, and array and
> structure offsets are limited to 16 bits anyway.
> 
> I would like to start tagging testcases that don't run on 16 bit
> platforms like the m32c, but first I need clear direction on which
> tags to use.  Comments?

Add and use whatever effective targets make sense to you, making sure
that the comments are clear for each new check_effective_target_* proc.
It's easy enough to go back and change them later if someone comes up
with a more elegant set.

Janis


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