This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [SPARC] Fix PR target/60941
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 25 Apr 2014 12:59:16 +0200
- Subject: Re: [SPARC] Fix PR target/60941
- Authentication-results: sourceware.org; auth=none
- References: <3316944 dot sc4MgGFZdG at polaris>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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