[Bug rtl-optimization/52785] Compile with -O fails in gcc 4.7

2012-03-29 Thread sergio at serjux dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52785

--- Comment #1 from Sérgio Basto sergio at serjux dot com 2012-03-30 01:41:12 
UTC ---
Here is the 3rd issue:

http://lists.x.org/archives/xorg/2012-March/054377.html


[Bug rtl-optimization/52785] Compile with -O fails in gcc 4.7

2012-03-29 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52785

--- Comment #2 from Andrew Pinski pinskia at gcc dot gnu.org 2012-03-30 
01:47:34 UTC ---
From reading the other bug reports, they all sound like it is really a bug in
the source and not in GCC.

for the -O1 issue you really to look at the preprocessed source, I bet 100%
there is a macro being used that you don't expect being used.


[Bug rtl-optimization/52785] Compile with -O fails in gcc 4.7

2012-03-29 Thread sergio at serjux dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52785

--- Comment #3 from Sérgio Basto sergio at serjux dot com 2012-03-30 02:13:44 
UTC ---
Created attachment 27041
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=27041
preprocessed source with -O1

/usr/include/xorg/os.h:496:55: error: expected identifier or ‘(’ before
‘__extension__’

line 496 is:
extern _X_EXPORT char * strndup(const char *str, size_t n);

we have just 3 strndup in teste.i

don't see anything wrong


[Bug rtl-optimization/52785] Compile with -O fails in gcc 4.7

2012-03-29 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52785

Andrew Pinski pinskia at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID

--- Comment #4 from Andrew Pinski pinskia at gcc dot gnu.org 2012-03-30 
02:18:18 UTC ---
strndup is a macro in glibc header files.  Use (strndup) to disable the macro
function.

This is not a GCC bug or a glibc bug (since you supply  _GNU_SOURCE which says
define this macro) as the header is using something in the GNU_SOURCE
namespace.


[Bug rtl-optimization/52785] Compile with -O fails in gcc 4.7

2012-03-29 Thread sergio at serjux dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52785

--- Comment #5 from Sérgio Basto sergio at serjux dot com 2012-03-30 02:39:25 
UTC ---
(In reply to comment #4)
 strndup is a macro in glibc header files.  Use (strndup) to disable the macro
 function.
 
 This is not a GCC bug or a glibc bug (since you supply  _GNU_SOURCE which says
 define this macro) as the header is using something in the GNU_SOURCE
 namespace.

Sorry , could you help me try solve this 
the code is : 

#ifndef HAVE_STRNDUP
extern _X_EXPORT char * strndup(const char *str, size_t n);
#endif

so  -DHAVE_STRNDUP make source compile , what or how I fix the source ?