This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67739] New: name clash between builtin functions and local variables when optimization is on
- From: "milan.durovic at ali dot com.au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Sep 2015 06:09:30 +0000
- Subject: [Bug c++/67739] New: name clash between builtin functions and local variables when optimization is on
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67739
Bug ID: 67739
Summary: name clash between builtin functions and local
variables when optimization is on
Product: gcc
Version: 4.9.3
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: milan.durovic at ali dot com.au
Target Milestone: ---
Created attachment 36404
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36404&action=edit
simple test program illustrating the problem with gcc 4.8.1
This bug also appears in 4.8.1 version.
We have a local static array called 'sincos'. The code is calculating sin() and
cos() of the same value.
Compiler generates a call to 'sincos' method. However, the address of 'sincos'
method is resolved to be the address of the local static variable of the same
name, leading to an error. Compiler hasn't generated ANY warnings about this
name clash.
Identical problem exists in 4.8.1 compiler, except that here the function name
is 'sincosf'. It seems like this is a long standing error.
Compiler invocation:
gcc -O1 -lm test.c -Wall -Wextra -save-temps
Then:
./a.out
does segmentation fault.