This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/72769] New: ifstream Optimed Out ?
- From: "roy at chameleon dot ad" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 01 Aug 2016 15:09:21 +0000
- Subject: [Bug c++/72769] New: ifstream Optimed Out ?
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72769
Bug ID: 72769
Summary: ifstream Optimed Out ?
Product: gcc
Version: 6.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: roy at chameleon dot ad
Target Milestone: ---
Created attachment 39041
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39041&action=edit
the ii file
This is my first bug report so be patient!
g++ version is 6.1.1 20160707 [gcc-6-branch revision 238088]
Full compilation flag are those
https://gist.github.com/RoyBellingan/be151f3d22e7e0a50143d5dde622baba
System type is uname --all
Linux linux-gzgr 4.6.2-1-default #1 SMP PREEMPT Fri Jun 10 08:12:44 UTC 2016
(2a68ef0) x86_64 x86_64 x86_64 GNU/Linux
The invocation line is
g++-6 -save-temps -O2 campaigns/1350_tmp.cpp -std=c++11 -g -o
campaigns/1350_3.so -shared -fPIC -Wall -Wconversion -Wsign-compare
-pedantic-errors -I data/
Output given is
https://gist.github.com/RoyBellingan/7c09b6bf8908f62b9052575bf14cf43d just some
warning of non used variable (this code is create dynamically and loaded via
dlopen)
The .ii file is attached
In short the at line 37937 of the ii file
while (infile >> a){
fails because a is set to 0 WHEN the compiler is invoked with O2 (and also with
O1)
If I use O0 a is assigned the correct value ...
For now a "fix" is to force swap the first line in a std:string (the two empty
line at 37935 & 37936
unsigned long long a;
std::ifstream infile("campaigns/1350_ids");
std::string cry;
infile >> cry;
while (infile >> a){
ids.insert(std::pair<unsigned long long,bool>(a,1));
}
The 1350_ids file contains a list of id to check some rows are here
https://gist.github.com/RoyBellingan/8dcde8d63001dfcd438ccf9921f60627
Hope is enought!