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: [SPARC] Fix PR target/60941


On Fri, Apr 25, 2014 at 12:47:32PM +0200, Eric Botcazou wrote:
> /* PR target/60941 */
> /* Reported by Martin Husemann <martin@netbsd.org> */
> 
> extern void abort (void);
> 
> static void __attribute__((noinline))
> set (unsigned long *l)
> {
>   *l = 31;
> }
> 
> int main (void)
> {
>   unsigned long l;
>   int i;
> 
>   set (&l);
>   i = (int) l;
>   l = (unsigned long)(2U << i);
>   if (l != 0)
>     abort ();
>   return 0;
> }

I'm afraid the testcase will fail on int16 targets, so perhaps
you should guard the body of main other than return 0; with
#if __INT_MAX__ >= 2147483647ULL
or
#if __SIZEOF_INT__ >= 4
or similar (or require int32plus target, but gcc.c-torture/execute/
is not a good place for that and *.x files are terribly ugly, so
better would be to move the test to gcc.dg/torture/ in that case).

	Jakub


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