[Bug driver/56469] New: The .gcno file being generated is not cleaned up after gcc exits with an error.

2013-02-26 Thread kyusic at gmail dot com

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

 Bug #: 56469
   Summary: The .gcno file being generated is not cleaned up after
gcc exits with an error.
Classification: Unclassified
   Product: gcc
   Version: 4.7.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: driver
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: kyu...@gmail.com


gcc version: 4.7.2

system type: x86_64 linux gnu

configuration option: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.7.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu

command line: gcc -ftest-coverage -c a.c

compiler output:
a.c: In function ‘f’:
a.c:2:1: error: expected declaration or statement at end of input

preprocessed file:
# 1 "a.c"
# 1 ""
# 1 "a.c"
int f()
{

bug description:
Since the compiler exited with error, it is expected that the files it was
generating be cleaned up. However, a.gcno file which is one of them is left not
deleted.


[Bug c++/41384] New: initialization failure of global const variable of template class which has a constructor initializing its member which is a pointer to member data when compiled with -O2

2009-09-16 Thread kyusic at gmail dot com
I wrote the following code.

-- begin file haha.cc ---
struct C {
int i;
};

template 
struct A {
A() : p(&C::i) {}
int C::*p;
};

const A r;

int main()
{
return 0;
}
 end file haha.cc -

And I compiled it with -O2 switch. The exact compilation command given was:
$ g++ -O2 -Wall haha.cc

The compiler didn't produce any errors nor warnings. But when I ran the
generated binary, 'Segmentation fault' came up.

If you (1) make struct A a non-template class or (2) define r as non-const or
(3) declare A::p as a normal pointer or (4) don't give -O2 switch, it compiles
and runs well.

The following is the output from 'gcc -v' command:
$ gcc -v
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)


-- 
   Summary: initialization failure of global const variable of
template class which has a constructor initializing its
member which is a pointer to member data when compiled
with -O2
   Product: gcc
   Version: 3.4.6
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kyusic at gmail dot com
 GCC build triplet: x86_64-redhat-linux
  GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux


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



[Bug c++/57392] New: The result of a .* expression is rvalue in a function template when its object expression is lvalue.

2013-05-23 Thread kyusic at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57392

Bug ID: 57392
   Summary: The result of a .* expression is rvalue in a function
template when its object expression is lvalue.
   Product: gcc
   Version: 4.7.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: kyusic at gmail dot com

Created attachment 30178
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30178&action=edit
preprocessed source

g++ rejects the following program in c++11 mode:

-- begin -
struct A
{
int i;
};

void g(int& p) {}

template 
void f()
{
A a;
int A::*pm = &A::i;
g(a.*pm); // (*)
}
- end 

It says the expression 'a.*pm' at the line marked with (*) is rvalue, which
should be lvalue because its object expression 'a' is lvalue.

It compiles fine when f() is not templated.

g++-4.8.0 has the same problem.

Following is the compiler message:

- begin 
$ g++ -v -save-temps -c -std=c++11 a.cc
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.7.3/configure --enable-languages=c++
--disable-multilib
Thread model: posix
gcc version 4.7.3 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-std=c++11' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.7.3/cc1plus -E -quiet -v
-imultilib . -imultiarch x86_64-linux-gnu -D_GNU_SOURCE a.cc -mtune=generic
-march=x86-64 -std=c++11 -fpch-preprocess -o a.ii
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3/x86_64-unknown-linux-gnu/.

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3/backward
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/include
 /usr/local/include
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-std=c++11' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.7.3/cc1plus -fpreprocessed
a.ii -quiet -dumpbase a.cc -mtune=generic -march=x86-64 -auxbase a -std=c++11
-version -o a.s
GNU C++ (GCC) version 4.7.3 (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.7.3, GMP version 5.0.5, MPFR version 3.1.1-p2,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.7.3 (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.7.3, GMP version 5.0.5, MPFR version 3.1.1-p2,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: e27c3e349c650e830c6a08a9bf1d2e03
a.cc: In function ‘void f()’:
a.cc:13:12: error: invalid initialization of non-const reference of type ‘int&’
from an rvalue of type ‘int’
a.cc:6:6: error: in passing argument 1 of ‘void g(int&)’
-- end --

[Bug c++/50626] New: ICE with non-variadic function arguments after variadic one

2011-10-05 Thread kyusic at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50626

 Bug #: 50626
   Summary: ICE with non-variadic function arguments after
variadic one
Classification: Unclassified
   Product: gcc
   Version: 4.6.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: kyu...@gmail.com


ICE is raised with the following source code. I'm not sure if it's valid code.

===
template 
int f(T*... x, int y)
{
return y;
}

int main()
{
f(1);
return 0;
}
=

Following is the command line options and the compiler output.

=
$ g++-4.6.1 -v -save-temps -std=c++0x -Wall haha.cc
Using built-in specs.
COLLECT_GCC=g++-4.6.1
COLLECT_LTO_WRAPPER=/usr/local/packages/gcc-4.6.1/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.6.1/configure --prefix=/usr/local/packages/gcc-4.6.1
Thread model: posix
gcc version 4.6.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-Wall' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

/usr/local/packages/gcc-4.6.1/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/cc1plus
-E -quiet -v -D_GNU_SOURCE haha.cc -mtune=generic -march=x86-64 -std=c++0x
-Wall -fpch-preprocess -o haha.ii
ignoring nonexistent directory
"/usr/local/packages/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/packages/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1

/usr/local/packages/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/x86_64-unknown-linux-gnu

/usr/local/packages/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/backward
 /usr/local/packages/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/include
 /usr/local/include
 /usr/local/packages/gcc-4.6.1/include

/usr/local/packages/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-Wall' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

/usr/local/packages/gcc-4.6.1/libexec/gcc/x86_64-unknown-linux-gnu/4.6.1/cc1plus
-fpreprocessed haha.ii -quiet -dumpbase haha.cc -mtune=generic -march=x86-64
-auxbase haha -Wall -std=c++0x -version -o haha.s
GNU C++ (GCC) version 4.6.1 (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.0,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.6.1 (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.0,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 89dcf4f0326a9a75d3a96096777c9003
haha.cc: In function ‘int f(T* ..., int) [with T = {}]’:
haha.cc:9:5:   instantiated from here
haha.cc:4:9: internal compiler error: in tsubst_copy, at cp/pt.c:11305
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.



[Bug c++/50626] ICE with non-variadic function arguments after variadic one

2011-10-05 Thread kyusic at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50626

--- Comment #1 from Gyusik Choe  2011-10-06 02:09:22 
UTC ---
Created attachment 25427
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25427
preporcessed file