From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72661 invoked by alias); 28 Sep 2015 21:05:13 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 72632 invoked by uid 48); 28 Sep 2015 21:05:09 -0000 From: "milan.durovic at ali dot com.au" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/67739] name clash between builtin functions and local variables when optimization is on Date: Mon, 28 Sep 2015 21:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: milan.durovic at ali dot com.au X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-09/txt/msg02224.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67739 --- Comment #3 from Milan Durovic --- I think a warning is the right answer. You can't expect people to be aware of all built-in functions. I wasn't aware that there was such a function called 'sincos'. And even more importantly, the name clash is not really obvious for the simple reason that the function that the compiler invokes is not even explicitly exposed, ie. it doesn't appear in the source code. And these change: in one version, compiler invokes sincosf and in another, sincos. So code that compiles and works fine with one compiler version would fail with another compiler version. Warning is the minimum that should happen, although I think if the compiler wants to invoke a particular, hidden function, and its name clashes with a program variable, then it's something compiler should automatically resolve.