public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/58981] [4.9 Regression] FAIL: gcc.target/i386/memset-1.c execution test
Date: Mon, 04 Nov 2013 01:22:00 -0000	[thread overview]
Message-ID: <bug-58981-4-0dIbyvaglD@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-58981-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58981

--- Comment #3 from Jan Hubicka <hubicka at ucw dot cz> ---
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58981
> 
> --- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
> The bug is in
> 
>       *count = expand_simple_binop (GET_MODE (*count), PLUS, *count,
>                                     saveddest, *count, 1, OPTAB_DIRECT);
> 
> (gdb) call debug_rtx (saveddest)
> (reg:SI 101)
> (gdb) call debug_rtx (*count)
> (reg:DI 100)
> (gdb) 
> 
> Add SImode address to DImode count to update count leads
> to count overflow. Instead, we should use mode of address
> here:
> 
> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
> index 902e169..b27bfb6 100644
> --- a/gcc/config/i386/i386.c
> +++ b/gcc/config/i386/i386.c
> @@ -23139,7 +23139,7 @@
> expand_set_or_movmem_prologue_epilogue_by_misaligned_moves (rtx destmem, rtx
> src
>        if (!issetmem)
>    *srcptr = expand_simple_binop (GET_MODE (*srcptr), MINUS, *srcptr,
> saveddest,
>                *srcptr, 1, OPTAB_DIRECT);
> -      *count = expand_simple_binop (GET_MODE (*count), PLUS, *count,
> +      *count = expand_simple_binop (GET_MODE (saveddest), PLUS, *count,

This looks OK, Thanks for looking into it!
Honza

>                 saveddest, *count, 1, OPTAB_DIRECT);
>        /* We copied at most size + prolog_size.  */
>        if (*min_size > (unsigned HOST_WIDE_INT)(size + prolog_size))
> 
> -- 
> You are receiving this mail because:
> You are on the CC list for the bug.


  parent reply	other threads:[~2013-11-04  1:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-03 17:45 [Bug target/58981] New: " hjl.tools at gmail dot com
2013-11-03 18:24 ` [Bug target/58981] " hjl.tools at gmail dot com
2013-11-03 20:49 ` hjl.tools at gmail dot com
2013-11-04  1:22 ` hubicka at ucw dot cz [this message]
2013-11-04  1:50 ` hjl.tools at gmail dot com
2013-11-04  5:36 ` [Bug middle-end/58981] " hjl.tools at gmail dot com
2013-11-04  6:03 ` hjl.tools at gmail dot com
2013-11-04 10:35 ` [Bug middle-end/58981] movmem/setmem use mode wider than Pmode for size hjl.tools at gmail dot com
2014-04-22 11:37 ` jakub at gcc dot gnu.org
2014-07-16 13:30 ` jakub at gcc dot gnu.org
2014-10-30 10:41 ` jakub at gcc dot gnu.org
2015-06-26 19:56 ` jakub at gcc dot gnu.org
2015-06-26 20:28 ` jakub at gcc dot gnu.org
2015-06-26 21:18 ` pinskia at gcc dot gnu.org

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=bug-58981-4-0dIbyvaglD@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).