public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Vladimir Makarov <vmakarov@redhat.com>, terry.guo@arm.com
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: patch to fix PR65648
Date: Tue, 07 Apr 2015 15:52:00 -0000	[thread overview]
Message-ID: <20150407155143.GK19273@tucnak.redhat.com> (raw)
In-Reply-To: <5523F167.3010606@redhat.com>

On Tue, Apr 07, 2015 at 11:01:59AM -0400, Vladimir Makarov wrote:
> 2015-04-07  Vladimir Makarov  <vmakarov@redhat.com>
> 
>         PR target/65678
>         * lra-remat.c (do_remat): Process input and non-input insn
>         registers separately.

Don't have a quick access to arm box right now (without waiting for it to be
installed etc.), but using a cross-compiler I can at least reproduce
that your patch changes also:

/* PR target/65648 */

int a = 0, *b = 0, c = 0;
static int d = 0;
short e = 1;
static long long f = 0;
long long *i = &f;
unsigned char j = 0;

__attribute__((noinline, noclone)) void
foo (int x, int *y)
{
  asm volatile ("" : : "r" (x), "r" (y) : "memory");
}

__attribute__((noinline, noclone)) void
bar (const char *x, long long y)
{
  asm volatile ("" : : "r" (x), "r" (&y) : "memory");
  if (y != 0)
    __builtin_abort ();
}

int
main ()
{
  int k = 0;
  b = &k;
  j = (!a) - (c <= e);
  *i = j;
  foo (a, &k);
  bar ("", f);
  return 0;
}

so, if anybody can confirm this testcase aborts with -march=armv6-m -mthumb -Os
before Vlad's patch and doesn't abort afterwards, perhaps just sticking
that into gcc.c-torture/execute/pr65648.c would be sufficient.
Or, if people don't regularly test with -march=armv6-m -mthumb combination,
perhaps put it into gcc.c-torture/execute/pr65648.c as is and
add another gcc.target/arm/pr65648.c testcase that will #include this one,
and use the right dg-options / dg-skip-if or dg-require-effective-target etc.
for it to trigger.  As the testcase uses uninitialized r3 in the wrong case,
I wonder if the usual _start initializes r3 to some value that triggers the abort
without the fix; if not, perhaps it needs to be in another function and the caller
should somehow attempt to set l3 somehow (pass arguments to another function etc.)
to a value that will trigger the abort.

	Jakub

  parent reply	other threads:[~2015-04-07 15:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-07 15:02 Vladimir Makarov
2015-04-07 15:04 ` Jakub Jelinek
2015-04-07 15:52 ` Jakub Jelinek [this message]
2015-04-07 19:28   ` Yvan Roux
2015-04-07 19:33     ` Jakub Jelinek
2015-04-07 20:02       ` Yvan Roux
2015-04-09 11:10         ` Yvan Roux
2015-04-09 11:16           ` Jakub Jelinek
2015-04-13 13:42           ` Kyrill Tkachov
2015-04-13 14:11             ` Yvan Roux
2015-04-13 14:36               ` Kyrill Tkachov
2015-04-13 14:37                 ` Jakub Jelinek
2015-04-14  8:19           ` Ramana Radhakrishnan
2015-04-14  8:32             ` Yvan Roux
2015-04-14  8:33               ` Jakub Jelinek
2015-04-14  8:35                 ` Ramana Radhakrishnan
2015-04-14  9:14                   ` Yvan Roux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150407155143.GK19273@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=terry.guo@arm.com \
    --cc=vmakarov@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).