Bug 758908

Summary: ICE in vectorizable_assignment, at tree-vect-stmts.c:1956
Product: [Fedora] Fedora Reporter: Ben Webb <ben>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 16CC: aravindvijayan224185, jakub
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-09 11:49:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Preprocessed source. none

Description Ben Webb 2011-11-30 23:19:40 UTC
Created attachment 538850 [details]
Preprocessed source.

Description of problem:
When trying to compile our code (preprocessed source attached) g++ encounters an internal compiler error.

Version-Release number of selected component (if applicable):
gcc-c++-4.6.2-1.fc16.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. Try to compile our source code with
g++ -o build/src/imp_core_all.os -c -isystem /clarinet1/home/ben/tmp/imp -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -Wall -Wextra -Wno-deprecated -Winit-self -Wstrict-aliasing=2 -Wcast-align -fno-operator-names -Wmissing-declarations -Wundef -Woverloaded-virtual -O3 -fexpensive-optimizations -ffast-math -ftree-vectorize -ffinite-math-only -fstrict-aliasing -fno-trapping-math -fno-signaling-nans -fno-float-store -Wno-unused -funsafe-loop-optimizations -fno-signed-zeros -freciprocal-math -fassociative-math -fvisibility=hidden -fPIC -DBOOST_ALL_NO_LIB -DIMPCORE_EXPORTS -DGCC_VISIBILITY -Ibuild/include -Ibuild/src build/src/imp_core_all.cpp

(I am assuming that the attached preprocessed code can also be compiled and will give the same error, so that you don't need to go to the hassle of checking out our code and going through its build system. Apologies for the size of the file! Please let me know if you need more information.)
  
Actual results:
Compilation fails with the error:
In file included from build/src/imp_core_all.cpp:4:0:
/clarinet1/home/ben/tmp/imp/modules/core/src/BallMover.cpp: In member function ‘virtual void IMP::core::BallMover::do_move(IMP::Float)’:
/clarinet1/home/ben/tmp/imp/modules/core/src/BallMover.cpp:33:6: internal compiler error: in vectorizable_assignment, at tree-vect-stmts.c:1956
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/cc6Zwls8.out file, please attach this to your bugreport.


Expected results:
Normal compilation, .o file generated.

Comment 1 Aravind vijayan 2011-12-08 01:07:01 UTC
I think this may be a URL to the file: BallMover.cpp

http://svn.salilab.org/imp/trunk/modules/core/src/BallMover.cpp



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 2 Ben Webb 2011-12-08 01:37:11 UTC
Of course I am happy to provide additional information if requested - I said as much in the original report. This includes the file itself (rather than a guess as to the URL!) if the preprocessed source is not sufficient to reproduce the problem.

That URL points to our SVN server, so you'll get the latest revision of that one file, not necessarily the revision that actually triggers the bug, of course. And compiling that file by itself does not trigger the bug - it has to be batch compiled with a bunch of other files and (as far as I can tell) a specific set of compiler flags.

Of course if the compiler guys can figure out the problem from that one file in isolation, that's great. But to me it looks like a pretty standard assignment-in-a-for-loop:

    for (int j = 0; j < get_number_of_keys(); ++j) {
      center[j] = get_value(i, j);
    }

For now I have avoided the ICE by running the loop backwards (which is what you'll see if you check out that URL), i.e.

    for (int j = get_number_of_keys() - 1; j >= 0; --j) {
      center[j] = get_value(i, j);
    }

Comment 3 Jakub Jelinek 2011-12-09 10:16:50 UTC
Reduced testcase at -O3:

struct A { A (); unsigned int a; };
double bar (A a) throw () __attribute__((pure));

void
foo (unsigned int x, double *y, A *z)
{
  unsigned int i;
  for (i = 0; i < x; i++)
    y[i] = bar (z[i]);
}

Unlike the original this one ICEs reliably in all of upstream trunk, 4.6 and 4.6-RH.

Comment 5 Aravind vijayan 2012-01-09 11:49:43 UTC
 Hi Ben,
        I think the patch worked for you.Let me close this bug feel free to open this at any time still you have difficulties on this issue.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers