public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paulo Matos <pmatos@broadcom.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: RE: Regression [v850,mep...]: sign_extend in loop breaks zero-overhead loop generation
Date: Thu, 30 Jan 2014 15:00:00 -0000	[thread overview]
Message-ID: <19EB96622A777C4AB91610E763265F463F3030@SJEXCHMB14.corp.ad.broadcom.com> (raw)
In-Reply-To: <87bnytk0fs.fsf@igel.home>

> -----Original Message-----
> From: Andreas Schwab [mailto:schwab@linux-m68k.org]
> Sent: 30 January 2014 14:29
> To: Paulo Matos
> Cc: gcc@gcc.gnu.org
> Subject: Re: Regression [v850,mep...]: sign_extend in loop breaks zero-overhead
> loop generation
> 
> Paulo Matos <pmatos@broadcom.com> writes:
> 
> > void
> > foo (short blockSize)
> > {
> >   short i;
> >   unsigned short loopCount;
> >
> >   loopCount = (unsigned short) (blockSize + delayLength) % 8;
> >   for (i = 0; i < loopCount; i++)
> >       *temp_ptr++ = x ^ *temp_ptr++;
> > }
> 
> You know that this is undefined code?
>

Correct, my apologies. I didn't notice the undefined behaviour that the reducer introduced in the original code.
However, the issue persists.
If instead I write:
void
foo (short blockSize)
{
  short i;
  unsigned short loopCount;
  loopCount = (unsigned short) (blockSize + delayLength) % 8;
  for (i = 0; i < loopCount; i++)
      *temp_ptr++ = x ^ *temp_ptr;
}

the sign extend is still generated from the referenced commit and persists until trunk. This causes the zero overhead loop not to be generated.

Thanks,

Paulo Matos
 
> Andreas.
> 
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

  reply	other threads:[~2014-01-30 14:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30 14:05 Paulo Matos
2014-01-30 14:37 ` Andreas Schwab
2014-01-30 15:00   ` Paulo Matos [this message]
2014-01-30 15:19     ` Andreas Schwab
2014-01-30 17:29       ` Paulo Matos
2014-01-30 18:07         ` Jeff Law
2014-01-31 10:40           ` Paulo Matos

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=19EB96622A777C4AB91610E763265F463F3030@SJEXCHMB14.corp.ad.broadcom.com \
    --to=pmatos@broadcom.com \
    --cc=gcc@gcc.gnu.org \
    --cc=schwab@linux-m68k.org \
    /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).