[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2018-09-10 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720
Bug 45720 depends on bug 43432, which changed state.

Bug 43432 Summary: Missed vectorization: "complicated access pattern" for 
increasing and decreasing data indexing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43432

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-10-22 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

--- Comment #7 from Richard Guenther rguenth at gcc dot gnu.org 2010-10-22 
08:59:56 UTC ---
We need some sort of a testcase.


[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-10-22 Thread vladimir.a.kharchenko at intel dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

--- Comment #8 from Vladimir Kharchenko vladimir.a.kharchenko at intel dot 
com 2010-10-22 10:15:16 UTC ---
It can happen that this file is minimal test case. :(
The piece of source:
961  if ((l_maxabs = temp.s_max[rw])  0)
962  {
963 l_maxabs = fabs(u.row.val[len]);
964
965 for (i = len - 1; i = beg; --i)
966if (l_maxabs  fabs(u.row.val[i]))   Seg. fault
967   l_maxabs = fabs(u.row.val[i]);
968
969 temp.s_max[rw] = l_maxabs;   /* # */
970  }
is executed many times in this test before Segmentation fault.
GDB shows that all objects (l_maxabs, fabs(u.row.val[i]), len, i, beg) have
correct values after Seg exception. Instructions after disassembler:
0x0041385b soplex::CLUFactor::selectPivots(soplex::Real)+2203:   
and$0x7,%r8d
0x0041385f soplex::CLUFactor::selectPivots(soplex::Real)+2207:   
movapd 0x0(%rbp),%xmm2  Seg. fault
0x00413864 soplex::CLUFactor::selectPivots(soplex::Real)+2212:   
cmp%r11d,%edx
also looks correct. %rbp points to correct memory.

So I have no hypotheses about the reason of this exception.
Maybe, it was indirect jump into the middle of instruction.
I will continue attemts to create short test case after weekend.


[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-10-22 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

--- Comment #9 from Uros Bizjak ubizjak at gmail dot com 2010-10-22 11:21:27 
UTC ---
(In reply to comment #8)

 So I have no hypotheses about the reason of this exception.
 Maybe, it was indirect jump into the middle of instruction.
 I will continue attemts to create short test case after weekend.

Try to run the test under valgrind. This tool is much more powerful.


[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-10-22 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2010.10.22 12:25:43
 Ever Confirmed|0   |1

--- Comment #10 from Richard Guenther rguenth at gcc dot gnu.org 2010-10-22 
12:25:43 UTC ---
Peeling for alignment needs adjustment:

float val[256];
float x;
void __attribute__((noinline,noclone))
foo(int len, int beg)
{
  int i;
  for (i = len - 1; i = beg; --i)
x += val[i] * 2;
}
int main()
{
  foo(256-3, 0);
  return 0;
}

segfaults.  We align val[len-1] instead of val[len-4].


[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-10-22 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

--- Comment #11 from Richard Guenther rguenth at gcc dot gnu.org 2010-10-22 
13:22:18 UTC ---
Created attachment 22116
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=22116
untested patch

Patch which fixes the testcase (and some more).


[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-10-22 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

--- Comment #12 from Richard Guenther rguenth at gcc dot gnu.org 2010-10-22 
14:44:53 UTC ---
Author: rguenth
Date: Fri Oct 22 14:44:48 2010
New Revision: 165832

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=165832
Log:
2010-10-22  Richard Guenther  rguent...@suse.de

PR tree-optimization/45720
* tree-vect-data-refs.c (vect_update_misalignment_for_peel):
Handle negative step.
(vect_enhance_data_refs_alignment): Likewise.
* tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Likewise.
(vect_create_cond_for_align_checks): Likewise.
(vect_create_cond_for_alias_checks): Likewise.

* gcc.dg/torture/pr45720.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr45720.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vect-data-refs.c
trunk/gcc/tree-vect-loop-manip.c


[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-10-22 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

H.J. Lu hjl.tools at gmail dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #13 from H.J. Lu hjl.tools at gmail dot com 2010-10-23 02:08:57 
UTC ---
Fixed as of revision 165840.


[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-10-21 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

--- Comment #2 from hjl at gcc dot gnu.org hjl at gcc dot gnu.org 2010-10-03 
05:41:44 UTC ---
Author: hjl
Date: Sun Oct  3 05:39:32 2010
New Revision: 164914

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=164914
Log:
Disallow negative steps in vectorizer.

gcc/

2010-10-02  H.J. Lu  hongjiu...@intel.com

PR tree-optimization/45720
PR tree-optimization/45764
* tree-vect-data-refs.c (vect_analyze_data_ref_access):
Don't accept backwards consecutive accesses.
(vect_create_data_ref_ptr): Disallow negative steps.

* tree-vect-stmts.c (vectorizable_store): Allow negative steps.
(perm_mask_for_reverse): Removed.
(reverse_vec_elements): Likewise.
(vectorizable_load): Don't hanle negative steps.

gcc/testsuite/

2010-10-02  H.J. Lu  hongjiu...@intel.com

PR tree-optimization/45720
PR tree-optimization/45764
* g++.dg/torture/pr45764.C: New.

* gcc.dg/vect/pr43432.c: Xfail.
* gcc.dg/vect/vect-114.c: Likewise.
* gcc.dg/vect/vect-15.c: Likewise.

Added:
trunk/gcc/testsuite/g++.dg/torture/pr45764.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/vect/pr43432.c
trunk/gcc/testsuite/gcc.dg/vect/vect-114.c
trunk/gcc/testsuite/gcc.dg/vect/vect-15.c
trunk/gcc/tree-vect-data-refs.c
trunk/gcc/tree-vect-stmts.c

--- Comment #3 from Richard Guenther rguenth at gcc dot gnu.org 2010-10-21 
10:03:49 UTC ---
Likely a dup of PR45764 which has all the analysis.


[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-10-21 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

--- Comment #4 from H.J. Lu hjl.tools at gmail dot com 2010-10-21 16:28:24 
UTC ---
As of revision 165771, I still got

With runspec -c lnx-i686-gcc.cfg -n 1 -l -o asc -I all -T peak

*** Miscompare of ref.out, see
/export/gnu/import/svn/gcc-test/spec/2000/i686/spec/benchspec/CINT2000/254.gap/run/0002/ref.out.mis

Error: 1x254.gap

With runspec -c lnx-x86_64-gcc.cfg -n 1 -l -o asc -I all -T peak

*** Miscompare of crafty.out, see
/export/gnu/import/svn/gcc-test/spec/2000/x86_64/spec/benchspec/CINT2000/186.crafty/run/0002/crafty.out.mis

*** Miscompare of inp.out, see
/export/gnu/import/svn/gcc-test/spec/2000/x86_64/spec/benchspec/CFP2000/200.sixtrack/run/0002/inp.out.mis

Error: 1x186.crafty 1x200.sixtrack


[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-10-21 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

--- Comment #5 from H.J. Lu hjl.tools at gmail dot com 2010-10-22 00:28:51 
UTC ---
With SPEC CPU 2006, revision 165771 gave me:

1. 64bit using-O3 -funroll-loops -ffast-math:

  Running 450.soplex ref peak lnx32e-gcc default

450.soplex: copy 0 non-zero return code (exit code=0, signal=11)

  Running 481.wrf ref peak lnx32e-gcc default

481.wrf: copy 0 non-zero return code (exit code=0, signal=11)

2. 32bit using -O3 -funroll-loops -msse2 -mfpmath=sse -ffast-math:  

  Running 481.wrf ref peak lnx32-gcc default

481.wrf: copy 0 non-zero return code (exit code=0, signal=11)


[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-10-21 Thread vladimir.a.kharchenko at intel dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

--- Comment #6 from Vladimir Kharchenko vladimir.a.kharchenko at intel dot 
com 2010-10-22 04:28:46 UTC ---
Quick investigation of 450.soplex failure shows that Segmentation fault is in
line 966 (file factor.cc). When I recompiled this file without the option
-ffast=math, test passed.


[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-09-29 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P1


[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-09-18 Thread hjl dot tools at gmail dot com


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

   Target Milestone|--- |4.6.0


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



[Bug middle-end/45720] [4.6 regression] Revision 164367 miscompiled SPEC CPU 2K

2010-09-18 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2010-09-18 18:45 ---
I also see 450.soplex and 481.wrf fail.


-- 


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