public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* <altivec.h> not happy with 3.4 on powerpc-apple-darwin7.2.0
@ 2004-01-18 19:31 Timothy J. Wood
  2004-01-18 19:49 ` [PATCH] [COMMITTED] Fix " Andrew Pinski
  2004-01-18 23:23 ` Ziemowit Laski
  0 siblings, 2 replies; 6+ messages in thread
From: Timothy J. Wood @ 2004-01-18 19:31 UTC (permalink / raw)
  To: gcc




Configured thusly:

	../gcc/configure --prefix="$PREFIX" --enable-languages="c,c++,objc"

Compiling just:

	#include <altivec.h>

with:

	$PREFIX/bin/c++ -O3 -maltivec x.cpp -S -o x.s

yields zillions of errors of the form:

In file included from x.cpp:2:
/Volumes/Space/Users/bungi/Source-head/GNU/gcc/gcc-3.4/install/bin/../ 
lib/gcc/powerpc-apple-darwin7.2.0/3.4.0/include/altivec.h:124: error:  
declaration of C function `float __vector__ vec_ctf(int __vector__,  
char)' conflicts with
/Volumes/Space/Users/bungi/Source-head/GNU/gcc/gcc-3.4/install/bin/../ 
lib/gcc/powerpc-apple-darwin7.2.0/3.4.0/include/altivec.h:123: error:  
previous declaration `float __vector__ vec_ctf(unsigned int __vector__,  
char)' here
...


-tim

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

* [PATCH] [COMMITTED] Fix Re: <altivec.h> not happy with 3.4 on powerpc-apple-darwin7.2.0
  2004-01-18 19:31 <altivec.h> not happy with 3.4 on powerpc-apple-darwin7.2.0 Timothy J. Wood
@ 2004-01-18 19:49 ` Andrew Pinski
  2004-01-22  6:27   ` Segher Boessenkool
  2004-01-18 23:23 ` Ziemowit Laski
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Pinski @ 2004-01-18 19:49 UTC (permalink / raw)
  To: Timothy J. Wood; +Cc: Gcc Patch List, Andrew Pinski, gcc mailing list

The problem is that on darwin, the system headers are defined to c  
headers as some of them
(mach ones) are C++ complaint.

I committed this to the 3.4 branch and the mainline as obvious.

Thanks,
Andrew Pinski

ChangeLog:
2004-01-18  Andrew Pinski  <pinskia@physics.uc.edu>

	* config/rs6000/altivec.h: Wrap C++ functions in extern "C++"
	block.


Patch:
Index: config/rs6000/altivec.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/altivec.h,v
retrieving revision 1.25
diff -u -p -r1.25 altivec.h
--- config/rs6000/altivec.h	16 Dec 2003 07:42:08 -0000	1.25
+++ config/rs6000/altivec.h	18 Jan 2004 19:48:58 -0000
@@ -118,6 +118,8 @@ extern int __altivec_link_error_invalid_

  #ifdef __cplusplus

+extern "C++" {
+
  /* Prototypes for builtins that take literals and must always be
     inlined.  */
  inline vector float vec_ctf (vector unsigned int, const char)  
__attribute__ ((always_inline));
@@ -6117,6 +6119,8 @@ struct __vec_step_help<vector float>

  #define vec_step(t)  __vec_step_help<typeof(t)>::_S_elem

+}//extern "C++"
+
  #else /* not C++ */

  /* "... and so I think no man in a century will suffer as greatly as
@@ -8532,6 +8536,7 @@ __ch (__bin_args_eq (vector float, (a1),
  #define vec_any_numeric(a1) __builtin_altivec_vcmpeqfp_p  
(__CR6_EQ_REV, (a1), (a1))

  #define vec_any_out(a1, a2) __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV,  
(a1), (a2))
+

  #endif /* __cplusplus */



On Jan 18, 2004, at 11:31, Timothy J. Wood wrote:

> Configured thusly:
>
> 	../gcc/configure --prefix="$PREFIX" --enable-languages="c,c++,objc"
>
> Compiling just:
>
> 	#include <altivec.h>
>
> with:
>
> 	$PREFIX/bin/c++ -O3 -maltivec x.cpp -S -o x.s
>
> yields zillions of errors of the form:
>
> In file included from x.cpp:2:
> /Volumes/Space/Users/bungi/Source-head/GNU/gcc/gcc-3.4/install/bin/../ 
> lib/gcc/powerpc-apple-darwin7.2.0/3.4.0/include/altivec.h:124: error:  
> declaration of C function `float __vector__ vec_ctf(int __vector__,  
> char)' conflicts with
> /Volumes/Space/Users/bungi/Source-head/GNU/gcc/gcc-3.4/install/bin/../ 
> lib/gcc/powerpc-apple-darwin7.2.0/3.4.0/include/altivec.h:123: error:  
> previous declaration `float __vector__ vec_ctf(unsigned int  
> __vector__, char)' here
> ...
>
>
> -tim
>
>
>

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

* Re: <altivec.h> not happy with 3.4 on powerpc-apple-darwin7.2.0
  2004-01-18 19:31 <altivec.h> not happy with 3.4 on powerpc-apple-darwin7.2.0 Timothy J. Wood
  2004-01-18 19:49 ` [PATCH] [COMMITTED] Fix " Andrew Pinski
@ 2004-01-18 23:23 ` Ziemowit Laski
  2004-01-18 23:51   ` Timothy J. Wood
  1 sibling, 1 reply; 6+ messages in thread
From: Ziemowit Laski @ 2004-01-18 23:23 UTC (permalink / raw)
  To: Timothy J. Wood; +Cc: gcc

Tim,

I have a patch that fixes this issue, among with many others.  Alas, no  
one has deigned to review it, much less approve it:

   http://gcc.gnu.org/ml/gcc-patches/2004-01/msg01111.html

--Zem

On 18 Jan 2004, at 11.31, Timothy J. Wood wrote:

>
>
>
> Configured thusly:
>
> 	../gcc/configure --prefix="$PREFIX" --enable-languages="c,c++,objc"
>
> Compiling just:
>
> 	#include <altivec.h>
>
> with:
>
> 	$PREFIX/bin/c++ -O3 -maltivec x.cpp -S -o x.s
>
> yields zillions of errors of the form:
>
> In file included from x.cpp:2:
> /Volumes/Space/Users/bungi/Source-head/GNU/gcc/gcc-3.4/install/bin/../ 
> lib/gcc/powerpc-apple-darwin7.2.0/3.4.0/include/altivec.h:124: error:  
> declaration of C function `float __vector__ vec_ctf(int __vector__,  
> char)' conflicts with
> /Volumes/Space/Users/bungi/Source-head/GNU/gcc/gcc-3.4/install/bin/../ 
> lib/gcc/powerpc-apple-darwin7.2.0/3.4.0/include/altivec.h:123: error:  
> previous declaration `float __vector__ vec_ctf(unsigned int  
> __vector__, char)' here
> ...
>
>
> -tim
>

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

* Re: <altivec.h> not happy with 3.4 on powerpc-apple-darwin7.2.0
  2004-01-18 23:23 ` Ziemowit Laski
@ 2004-01-18 23:51   ` Timothy J. Wood
  0 siblings, 0 replies; 6+ messages in thread
From: Timothy J. Wood @ 2004-01-18 23:51 UTC (permalink / raw)
  To: Ziemowit Laski; +Cc: gcc


   Andrew Pinski's patch  
<http://gcc.gnu.org/ml/gcc-patches/2004-01/msg01808.html> fixed  
particular the problem I was having.  I'm not qualified to say whether  
your patch might fix other issues I'll find later, though :)

-tim



On Jan 18, 2004, at 3:22 PM, Ziemowit Laski wrote:

> Tim,
>
> I have a patch that fixes this issue, among with many others.  Alas,  
> no one has deigned to review it, much less approve it:
>
>   http://gcc.gnu.org/ml/gcc-patches/2004-01/msg01111.html
>
> --Zem
>
> On 18 Jan 2004, at 11.31, Timothy J. Wood wrote:
>
>>
>>
>>
>> Configured thusly:
>>
>> 	../gcc/configure --prefix="$PREFIX" --enable-languages="c,c++,objc"
>>
>> Compiling just:
>>
>> 	#include <altivec.h>
>>
>> with:
>>
>> 	$PREFIX/bin/c++ -O3 -maltivec x.cpp -S -o x.s
>>
>> yields zillions of errors of the form:
>>
>> In file included from x.cpp:2:
>> /Volumes/Space/Users/bungi/Source-head/GNU/gcc/gcc-3.4/install/bin/ 
>> ../lib/gcc/powerpc-apple-darwin7.2.0/3.4.0/include/altivec.h:124:  
>> error: declaration of C function `float __vector__ vec_ctf(int  
>> __vector__, char)' conflicts with
>> /Volumes/Space/Users/bungi/Source-head/GNU/gcc/gcc-3.4/install/bin/ 
>> ../lib/gcc/powerpc-apple-darwin7.2.0/3.4.0/include/altivec.h:123:  
>> error: previous declaration `float __vector__ vec_ctf(unsigned int  
>> __vector__, char)' here
>> ...
>>
>>
>> -tim
>>
>

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

* Re: [PATCH] [COMMITTED] Fix Re: <altivec.h> not happy with 3.4 on powerpc-apple-darwin7.2.0
  2004-01-18 19:49 ` [PATCH] [COMMITTED] Fix " Andrew Pinski
@ 2004-01-22  6:27   ` Segher Boessenkool
  2004-01-22  8:50     ` Segher Boessenkool
  0 siblings, 1 reply; 6+ messages in thread
From: Segher Boessenkool @ 2004-01-22  6:27 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Timothy J. Wood, Gcc Patch List, gcc mailing list

On 18-jan-04, at 20:49, Andrew Pinski wrote:
> 	* config/rs6000/altivec.h: Wrap C++ functions in extern "C++"
> 	block.

I never heard about extern "C++" -- what is it, where is it documented?

> +}//extern "C++"

This is wrong; please use a /* */ comment (yes I use std=gnu99 for all 
my
own code, but not everyone does) (and coding conventions require some
more spaces, too ;-) )


Segher

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

* Re: [PATCH] [COMMITTED] Fix Re: <altivec.h> not happy with 3.4 on powerpc-apple-darwin7.2.0
  2004-01-22  6:27   ` Segher Boessenkool
@ 2004-01-22  8:50     ` Segher Boessenkool
  0 siblings, 0 replies; 6+ messages in thread
From: Segher Boessenkool @ 2004-01-22  8:50 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Gcc Patch List, Timothy J. Wood, gcc mailing list

> I never heard about extern "C++" -- what is it, where is it documented?

Wow, it turns out, I don't know C++ at all.

>> +}//extern "C++"
>
> This is wrong; please use a /* */ comment (yes I use std=gnu99 for all 
> my
> own code, but not everyone does) (and coding conventions require some
> more spaces, too ;-) )

Never mind, this was in #ifdef __cplusplus protected code, as Andrew 
pointed
out to me privately.  Which leaves only the spaces issue ;-)


Segher

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

end of thread, other threads:[~2004-01-22  8:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-18 19:31 <altivec.h> not happy with 3.4 on powerpc-apple-darwin7.2.0 Timothy J. Wood
2004-01-18 19:49 ` [PATCH] [COMMITTED] Fix " Andrew Pinski
2004-01-22  6:27   ` Segher Boessenkool
2004-01-22  8:50     ` Segher Boessenkool
2004-01-18 23:23 ` Ziemowit Laski
2004-01-18 23:51   ` Timothy J. Wood

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).