public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/64291] New: [5 Regression] Miscompile t-div in GMP's testsuite
@ 2014-12-12 17:41 glisse at gcc dot gnu.org
  2014-12-12 17:54 ` [Bug rtl-optimization/64291] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-12-12 17:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64291

            Bug ID: 64291
           Summary: [5 Regression] Miscompile t-div in GMP's testsuite
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org

In the following code, on x86_64-unknown-linux-gnu, we should call g(0,8,16),
but we somehow end up calling g(0,16,16). The most suspicious dump is
marc.c.228r.postreload.

$ gcc-4.9 -O2 marc.c f.c && ./a.out

$ gcc-5 -O2 marc.c f.c && ./a.out
a.out: f.c:3: g: Assertion `a==8' failed.
zsh: abort      ./a.out

$ cat f.c
#include <assert.h>
void f(void*p,...){}
void g(void*p,long a,long b){assert(a==8);}

$ cat marc.c
void f(void*,...);
void g(void*,long,long);
int nnn=0;
long test=0;

typedef struct
{
  int _mp_size;
  unsigned long *_mp_d;
} __mpz_struct;
typedef __mpz_struct mpz_t[1];

int main ()
{
  mpz_t n, d;
  long nn, dn;
  unsigned long *np, *dup, *dnp, *qp;
  long alloc, itch;

  f (n);
  f (d);
  qp = (unsigned long*)__builtin_alloca(4099*8) + 1;
  dnp = (unsigned long*)__builtin_alloca (2049*8);
  alloc = 1;
  for (test = 0; test < 1; test++)
  {
    dn = d->_mp_size;
    dup = d->_mp_d;
    f (dnp, dup, dn);
    dnp[dn - 1] |= 1UL<<63;
    f (0);
    nn = nnn;
    np = n->_mp_d;
    qp[-1] = -757136820;
    qp[nn - dn + 1] = 14883681;
    f (0);
    if (dn >= 6)
      f (0);
    itch = nn + 1;
    if (itch + 1> alloc)
    {
      g(0,alloc*8,(itch+1)*8);
      alloc = itch + 1;
    }
    f (np, nn);
  }
  return 0;
}


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/64291] [5 Regression] Miscompile t-div in GMP's testsuite
  2014-12-12 17:41 [Bug rtl-optimization/64291] New: [5 Regression] Miscompile t-div in GMP's testsuite glisse at gcc dot gnu.org
@ 2014-12-12 17:54 ` pinskia at gcc dot gnu.org
  2014-12-12 18:07 ` glisse at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-12-12 17:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64291

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Was this before or after revision 218658 ?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/64291] [5 Regression] Miscompile t-div in GMP's testsuite
  2014-12-12 17:41 [Bug rtl-optimization/64291] New: [5 Regression] Miscompile t-div in GMP's testsuite glisse at gcc dot gnu.org
  2014-12-12 17:54 ` [Bug rtl-optimization/64291] " pinskia at gcc dot gnu.org
@ 2014-12-12 18:07 ` glisse at gcc dot gnu.org
  2014-12-15  9:03 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-12-12 18:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64291

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Was this before or after revision 218658 ?

Exactly at 218658 (there were more failures before that).


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/64291] [5 Regression] Miscompile t-div in GMP's testsuite
  2014-12-12 17:41 [Bug rtl-optimization/64291] New: [5 Regression] Miscompile t-div in GMP's testsuite glisse at gcc dot gnu.org
  2014-12-12 17:54 ` [Bug rtl-optimization/64291] " pinskia at gcc dot gnu.org
  2014-12-12 18:07 ` glisse at gcc dot gnu.org
@ 2014-12-15  9:03 ` rguenth at gcc dot gnu.org
  2014-12-16 12:21 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-12-15  9:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64291

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |5.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/64291] [5 Regression] Miscompile t-div in GMP's testsuite
  2014-12-12 17:41 [Bug rtl-optimization/64291] New: [5 Regression] Miscompile t-div in GMP's testsuite glisse at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-12-15  9:03 ` rguenth at gcc dot gnu.org
@ 2014-12-16 12:21 ` jakub at gcc dot gnu.org
  2014-12-16 12:23 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-16 12:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64291

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-12-16
                 CC|                            |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r217587.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/64291] [5 Regression] Miscompile t-div in GMP's testsuite
  2014-12-12 17:41 [Bug rtl-optimization/64291] New: [5 Regression] Miscompile t-div in GMP's testsuite glisse at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-12-16 12:21 ` jakub at gcc dot gnu.org
@ 2014-12-16 12:23 ` jakub at gcc dot gnu.org
  2014-12-16 14:36 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-16 12:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64291

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> Started with r217587.

Oops, sorry for typo, r217588.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/64291] [5 Regression] Miscompile t-div in GMP's testsuite
  2014-12-12 17:41 [Bug rtl-optimization/64291] New: [5 Regression] Miscompile t-div in GMP's testsuite glisse at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-12-16 12:23 ` jakub at gcc dot gnu.org
@ 2014-12-16 14:36 ` rguenth at gcc dot gnu.org
  2014-12-18 20:50 ` vmakarov at gcc dot gnu.org
  2014-12-18 21:14 ` glisse at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-12-16 14:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64291

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-*, i?86-*-*
           Priority|P3                          |P1
                 CC|                            |vmakarov at gcc dot gnu.org


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/64291] [5 Regression] Miscompile t-div in GMP's testsuite
  2014-12-12 17:41 [Bug rtl-optimization/64291] New: [5 Regression] Miscompile t-div in GMP's testsuite glisse at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2014-12-16 14:36 ` rguenth at gcc dot gnu.org
@ 2014-12-18 20:50 ` vmakarov at gcc dot gnu.org
  2014-12-18 21:14 ` glisse at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: vmakarov at gcc dot gnu.org @ 2014-12-18 20:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64291

--- Comment #6 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
Author: vmakarov
Date: Thu Dec 18 20:49:44 2014
New Revision: 218874

URL: https://gcc.gnu.org/viewcvs?rev=218874&root=gcc&view=rev
Log:
2014-12-18  Vladimir Makarov  <vmakarov@redhat.com>

    PR rtl-optimization/64291
    * lra-remat.c (bad_for_rematerialization_p): Add UNPSEC_VLOATILE.
    (create_cands): Process only output reload insn with potential
    cands.

2014-12-18  Vladimir Makarov  <vmakarov@redhat.com>

    PR rtl-optimization/64291
    * testsuite/gcc.target/i386/pr64291-[12].c: New tests.


Added:
    trunk/gcc/testsuite/gcc.target/i386/pr64291-1.c
    trunk/gcc/testsuite/gcc.target/i386/pr64291-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lra-remat.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/64291] [5 Regression] Miscompile t-div in GMP's testsuite
  2014-12-12 17:41 [Bug rtl-optimization/64291] New: [5 Regression] Miscompile t-div in GMP's testsuite glisse at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2014-12-18 20:50 ` vmakarov at gcc dot gnu.org
@ 2014-12-18 21:14 ` glisse at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-12-18 21:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64291

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Marc Glisse <glisse at gcc dot gnu.org> ---
Thanks!


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-12-18 21:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-12 17:41 [Bug rtl-optimization/64291] New: [5 Regression] Miscompile t-div in GMP's testsuite glisse at gcc dot gnu.org
2014-12-12 17:54 ` [Bug rtl-optimization/64291] " pinskia at gcc dot gnu.org
2014-12-12 18:07 ` glisse at gcc dot gnu.org
2014-12-15  9:03 ` rguenth at gcc dot gnu.org
2014-12-16 12:21 ` jakub at gcc dot gnu.org
2014-12-16 12:23 ` jakub at gcc dot gnu.org
2014-12-16 14:36 ` rguenth at gcc dot gnu.org
2014-12-18 20:50 ` vmakarov at gcc dot gnu.org
2014-12-18 21:14 ` glisse at gcc dot gnu.org

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).