public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/59668] New: extraneous error messages at -O1, -O2 and -O3 for valid code with string library functions
@ 2014-01-03 20:36 su at cs dot ucdavis.edu
  2014-01-03 21:21 ` [Bug c/59668] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: su at cs dot ucdavis.edu @ 2014-01-03 20:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59668
           Summary: extraneous error messages at -O1, -O2 and -O3 for
                    valid code with string library functions
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The current trunk and older GCC versions reject the following code with odd
error messages at -O1, -O2 and -O3 (but not -O0 and -Os). 

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 4.9.0 20140103 (experimental) [trunk revision 206321] (GCC) 
$ 
$ gcc-trunk -Wall -Wextra -pedantic -std=c99 -c small.c
$ 
$ gcc-trunk -O0 -c small.c
$ gcc-trunk -Os -c small.c
$ 
$ gcc-trunk -O1 -c small.c
In file included from /usr/include/string.h:637:0,
                 from small.c:1:
small.c:3:5: error: expected identifier or ‘(’ before ‘__extension__’
 int strcmp(const char *, const char *);
     ^
small.c:3:5: error: expected identifier or ‘(’ before ‘)’ token
 int strcmp(const char *, const char *);
     ^
$ 


-----------------------


#include <string.h>

int strcmp(const char *, const char *);
>From gcc-bugs-return-439007-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jan 03 20:46:52 2014
Return-Path: <gcc-bugs-return-439007-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5999 invoked by alias); 3 Jan 2014 20:46:51 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 5969 invoked by uid 48); 3 Jan 2014 20:46:48 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/59668] extraneous error messages at -O1, -O2 and -O3 for valid code with string library functions
Date: Fri, 03 Jan 2014 20:46: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.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: glisse at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
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: <bug-59668-4-1ZfC8kKELz@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59668-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59668-4@http.gcc.gnu.org/bugzilla/>
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: 2014-01/txt/msg00149.txt.bz2
Content-length: 203

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY668

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Well, that's a glibc issue, isn't it?

Btw, you need to provide the preprocessed code.


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

end of thread, other threads:[~2014-01-03 22:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-03 20:36 [Bug c/59668] New: extraneous error messages at -O1, -O2 and -O3 for valid code with string library functions su at cs dot ucdavis.edu
2014-01-03 21:21 ` [Bug c/59668] " pinskia at gcc dot gnu.org
2014-01-03 21:31 ` su at cs dot ucdavis.edu
2014-01-03 21:39 ` pinskia at gcc dot gnu.org
2014-01-03 21:47 ` su at cs dot ucdavis.edu
2014-01-03 21:57 ` pinskia at gcc dot gnu.org
2014-01-03 22:56 ` schwab@linux-m68k.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).