public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67739] New: name clash between builtin functions and local variables when optimization is on
@ 2015-09-28  6:09 milan.durovic at ali dot com.au
  2015-09-28 11:02 ` [Bug c++/67739] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: milan.durovic at ali dot com.au @ 2015-09-28  6:09 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-11  1:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-28  6:09 [Bug c++/67739] New: name clash between builtin functions and local variables when optimization is on milan.durovic at ali dot com.au
2015-09-28 11:02 ` [Bug c++/67739] " rguenth at gcc dot gnu.org
2015-09-28 21:05 ` milan.durovic at ali dot com.au
2015-09-28 21:20 ` milan.durovic at ali dot com.au
2024-03-11  1:07 ` [Bug middle-end/67739] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).