public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vbyakovl23 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/55845] 454.calculix miscompares with -march=btver2 -O3 -ffastmath -fschedule-insns -mvzeroupper for test data run
Date: Fri, 04 Jan 2013 06:41:00 -0000	[thread overview]
Message-ID: <bug-55845-4-LFhdAVwJnz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55845-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #3 from Vladimir Yakovlev <vbyakovl23 at gmail dot com> 2013-01-04 06:40:44 UTC ---
The test fails corei7-avx also. I build a simple reproducer.

-------------------------------------------------------------
#include <stdio.h>

#define N 100

double
foo ( 
   int      size, 
   double   y[], 
   double   x[] 
)
{
  double sum = 0.0 ;
  int i ;
  for (i = 0, sum = 0. ; i < size ; i++)
    sum += y[i] * x[i] ; 
  return(sum);
}

int main ()
{
  double x[N];
  double y[N];
  double s;
  int i;

  for (i = 0; i < N; i++)
    {
      x[i] = i;
      y[i] = i;
    }

  s = foo (N, y, x);

  printf("%s\n", s == 328350 ? "pass" : "fail");
}
------------------------------------------------------

$ gcc -mavx -g -static  -o t  -O3 -ffast-math -march=corei7 t.c -fno-inline &&
./t
pass
$ gcc  -fschedule-insns -mavx -g -static  -o t  -O3 -ffast-math -march=corei7
t.c -fno-inline && ./t                                                          
fail

Responsible phase is jump2. To switch off the phase I did changes

diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 5d142e9..be04c5d 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -3070,6 +3070,7 @@ struct rtl_opt_pass pass_jump =
 static unsigned int
 execute_jump2 (void)
 {
+  if (!getenv("NOJMP2"))
   cleanup_cfg (flag_crossjumping ? CLEANUP_CROSSJUMP : 0);
   return 0;
 }

env NOJMP2=1 gcc  -fschedule-insns -mavx -g -static  -o t  -O3 -ffast-math
-march=corei7 t.c -fno-inline && ./t
pass

I used compiler
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure CFLAGS='-O0 -g3' CXXFLAGS='-O0 -g3'
--prefix=/gnumnt/msticlxl16_users/vbyakovl/workspaces/gcc/install
--enable-clocale=gnu --disable-bootstrap --with-system-zlib --enable-shared
--with-demangler-in-ld --with-fpmath=sse --with-arch=corei7-avx
--with-cpu=corei7-avx --enable-languages=c,c++,fortran,java,lto,objc
--no-create --no-recursion


  parent reply	other threads:[~2013-01-04  6:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-02  9:28 [Bug rtl-optimization/55845] New: " venkataramanan.kumar at amd dot com
2013-01-02 10:10 ` [Bug rtl-optimization/55845] " ubizjak at gmail dot com
2013-01-02 10:15 ` ubizjak at gmail dot com
2013-01-04  6:41 ` vbyakovl23 at gmail dot com [this message]
2013-01-04  8:13 ` ubizjak at gmail dot com
2013-01-04  9:12 ` venkataramanan.kumar at amd dot com
2013-01-04  9:20 ` ubizjak at gmail dot com
2013-01-04  9:25 ` venkataramanan.kumar at amd dot com
2013-01-04  9:35 ` [Bug rtl-optimization/55845] [4.8 Regression] " ubizjak at gmail dot com
2013-01-06 13:24 ` ubizjak at gmail dot com
2013-01-06 15:51 ` ubizjak at gmail dot com
2013-01-07 15:46 ` rguenth at gcc dot gnu.org
2013-01-08 18:01 ` jakub at gcc dot gnu.org
2013-01-08 18:04 ` jakub at gcc dot gnu.org
2013-01-15 14:05 ` venkataramanan.kumar at amd dot com

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-55845-4-LFhdAVwJnz@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).