Re: Type-punning

2007-06-22 Thread Sergei Organov
Herman Geza [EMAIL PROTECTED] writes: [...] What is the correct way to do this: void setNaN(float v) { reinterpret_castint(v) = 0x7f81; } without a type-prunning warning? I cannot use the union trick here Why? Won't the following work? void setNaN(float v) { union { float

Re: Type-punning

2007-06-22 Thread Sergei Organov
Chris Lattner [EMAIL PROTECTED] writes: On Jun 22, 2007, at 1:41 AM, Sergei Organov wrote: Herman Geza [EMAIL PROTECTED] writes: [...] What is the correct way to do this: void setNaN(float v) { reinterpret_castint(v) = 0x7f81; } without a type-prunning warning? I cannot use

Re: Option ordering

2007-05-31 Thread Sergei Organov
Manuel López-Ibáñez [EMAIL PROTECTED] writes: On 30 May 2007 16:12:12 -0700, Ian Lance Taylor [EMAIL PROTECTED] wrote: Joe Buck [EMAIL PROTECTED] writes: How about: have -Wall still set warn_strict_overflow to 1, but to have -Wall -Wstrict-overflow *or* -Wstrict-overflow -Wall *or* just

RFI: g++(templates): confusing error messages.

2007-05-30 Thread Sergei Organov
Hello, $ g++ -c err.cc err.cc:7: error: prototype for 'void Cint::foo(const int)' does not match any in class 'Cint' err.cc:3: error: candidate is: void CT::foo(const T) [with T = int] err.cc:7: error: template definition of non-template 'void Cint::foo(const int)' $ Note that substituting

Re: Embedded arm-elf-gcc

2007-03-27 Thread Sergei Organov
[EMAIL PROTECTED] writes: Hi everybody, I'm currently working in a company, as embedded developper, which use gnu tools. I have a good experience about non gnu compiler tools and i need help because the most disavantage of gcc compiler is the almost unexistant support for developper.

Re: For those using emacs ...

2007-03-13 Thread Sergei Organov
Andrew Walrond [EMAIL PROTECTED] writes: On Tuesday 13 March 2007 14:32:38 Andrew Haley wrote: ... a little tip. Add this to your c-mode-hook: (set-variable 'show-trailing-whitespace t) And you'll see all the trailing whitespace. On my system it appears bright red. Doesn't seem to

Re: What tells the coding style about whitespaces at end of lines or in *empty* lines ?

2007-03-01 Thread Sergei Organov
[EMAIL PROTECTED] (Richard Kenner) writes: It also forbids embedded horizontal tabs for similar reasons (avoiding junk difs). That would be a problem with GCC, due to emacs being so heavily used, but a similar convention *requiring* horizontal tabs would solve the issue in question. Emacs

Re: False ???noreturn??? function does return warnings

2007-02-07 Thread Sergei Organov
Jan Hubicka [EMAIL PROTECTED] writes: [...] static inline void __attribute__((noreturn)) BUG(void) { __asm__ __volatile__(trap); __builtin_unreached(); This is bit dificult to do in general since it introduces new kind of control flow construct. It would be better to express such

Re: Tricky(?) aliasing question.

2007-01-11 Thread Sergei Organov
Ian Lance Taylor [EMAIL PROTECTED] writes: Sergei Organov [EMAIL PROTECTED] writes: Below are two example functions foo() and boo(), that I think both are valid from the POV of strict aliasing rules. GCC 4.2 either warns about both (with -Wstrict-aliasing=2) or doesn't warn about any

Re: Tricky(?) aliasing question.

2007-01-11 Thread Sergei Organov
Andrew Haley [EMAIL PROTECTED] writes: Sergei Organov writes: Ian Lance Taylor [EMAIL PROTECTED] writes: Sergei Organov [EMAIL PROTECTED] writes: $ cat alias.c typedef struct { int i; } S; int i; int foo() { S const sc = { 10 }; i = 20

Re: Tricky(?) aliasing question.

2007-01-11 Thread Sergei Organov
Andrew Haley [EMAIL PROTECTED] writes: Sergei Organov writes: Andrew Haley [EMAIL PROTECTED] writes: Sergei Organov writes: Ian Lance Taylor [EMAIL PROTECTED] writes: Sergei Organov [EMAIL PROTECTED] writes: int float_as_int() { h1.f = 1

Re: Tricky(?) aliasing question.

2007-01-11 Thread Sergei Organov
Andrew Haley [EMAIL PROTECTED] writes: Sergei Organov writes: Andrew Haley [EMAIL PROTECTED] writes: Sergei Organov writes: Andrew Haley [EMAIL PROTECTED] writes: Sergei Organov writes: Ian Lance Taylor [EMAIL PROTECTED] writes: Sergei Organov

Re: Tricky(?) aliasing question.

2007-01-11 Thread Sergei Organov
Andrew Haley [EMAIL PROTECTED] writes: Sergei Organov writes: If we come back to strict aliasing rules, then I will have to refer once again to already cited place in the standard that says that I'm permitted to access an object not only through a compatible type, but also through

Re: Tricky(?) aliasing question.

2007-01-11 Thread Sergei Organov
Mike Stump [EMAIL PROTECTED] writes: On Jan 11, 2007, at 6:30 AM, Sergei Organov wrote: So h1.f is not an object? If it is not, it brings us back to the validity of my boo() function from the initial post, for which 2 persons (3 including me) thought it's OK: Would be nice for you to raise

Re: Tricky(?) aliasing question.

2007-01-11 Thread Sergei Organov
Silvius Rus [EMAIL PROTECTED] writes: [...] I am about to submit a patch that implements -Wstrict-aliasing in the backend based on flow-sensitive points-to information, which is computed by analyzing the entire source of each function. It is not perfect (the problem is undecidable), but it

Re: Tricky(?) aliasing question.

2007-01-11 Thread Sergei Organov
Andrew Haley [EMAIL PROTECTED] writes: Sergei Organov writes: BTW, I've tried once to raise similar aliasing question in comp.std.c++. The result was that somebody started to talk about validity of pointers conversions that IMHO has nothing to do with strict aliasing, It's

Re: Tricky(?) aliasing question.

2007-01-11 Thread Sergei Organov
Andrew Haley [EMAIL PROTECTED] writes: Sergei Organov writes: Andrew Haley [EMAIL PROTECTED] writes: Sergei Organov writes: If we come back to strict aliasing rules, then I will have to refer once again to already cited place in the standard that says that I'm

Re: 4.2 Project: @file support

2005-08-26 Thread Sergei Organov
Laurent GUERBY [EMAIL PROTECTED] writes: If we add a library function to handle this we might want to add a GNU-style argument equivalent like gcc --arguments-from-file=file AFAIK gcc doesn't support any GNU-style arguments, isn't it? I'd consider gcc @file gcc -@ file gcc -args-from-file

[PATCH] Minor documentation fix.

2005-07-01 Thread Sergei Organov
Index: invoke.texi === RCS file: /cvsroot/gcc/gcc/gcc/doc/invoke.texi,v retrieving revision 1.637 diff -u -r1.637 invoke.texi --- invoke.texi 15 Jun 2005 12:53:41 - 1.637 +++ invoke.texi 1 Jul 2005 14:52:13 - @@ -5225,7

Re: How to replace -O1 with corresponding -f's?

2005-06-24 Thread Sergei Organov
Andrew Pinski [EMAIL PROTECTED] writes: On Jun 20, 2005, at 11:28 AM, Sergei Organov wrote: Andrew Pinski [EMAIL PROTECTED] writes: On Jun 20, 2005, at 10:54 AM, Sergei Organov wrote: so SYMBOL_FLAG_SMALL (flags 0x6 vs 0x2) is somehow being missed when -O1 is turned on. Seems

Re: PowerPC small data sections.

2005-06-20 Thread Sergei Organov
Mike Stump [EMAIL PROTECTED] writes: On Friday, June 17, 2005, at 07:13 AM, Sergei Organov wrote: The first thing I'd like to get some advice on is which codebase do I use, gcc-4_0-branch? No, mainline. If it doesn't work there, is won't work anyplace else. :-( Once you get it working

How to replace -O1 with corresponding -f's?

2005-06-20 Thread Sergei Organov
Hi, Using gcc compiled from gcc-4_0-branch, in an attempt to see which particular optimization option makes my test case to be mis-optimized, I try to replace -O1 (which toggles on the problem) with corresponding set of -fxxx optimization options. I first compile my code like this: gcc -v

Re: How to replace -O1 with corresponding -f's?

2005-06-20 Thread Sergei Organov
Andrew Pinski [EMAIL PROTECTED] writes: On Jun 20, 2005, at 10:04 AM, Andrew Haley wrote: How one finds out what optimization pass misbehaves? Look at the dumps. If you use the gcc option -da you'll get a full set of RTL dump files. And -fdump-tree-all for the tree dumps. The last

Re: How to replace -O1 with corresponding -f's?

2005-06-20 Thread Sergei Organov
Andrew Pinski [EMAIL PROTECTED] writes: On Jun 20, 2005, at 9:38 AM, Sergei Organov wrote: 2. The resulting assembly is different from what I get with -O1 and doesn't contain the mis-optimization I'm trying to debug though it doesn't seem to have anything to do with loops

Re: How to replace -O1 with corresponding -f's?

2005-06-20 Thread Sergei Organov
Andrew Pinski [EMAIL PROTECTED] writes: On Jun 20, 2005, at 11:28 AM, Sergei Organov wrote: Andrew Pinski [EMAIL PROTECTED] writes: On Jun 20, 2005, at 10:54 AM, Sergei Organov wrote: so SYMBOL_FLAG_SMALL (flags 0x6 vs 0x2) is somehow being missed when -O1 is turned on. Seems

Re: How to replace -O1 with corresponding -f's?

2005-06-20 Thread Sergei Organov
Andrew Pinski [EMAIL PROTECTED] writes: On Jun 20, 2005, at 11:28 AM, Sergei Organov wrote: Andrew Pinski [EMAIL PROTECTED] writes: On Jun 20, 2005, at 10:54 AM, Sergei Organov wrote: so SYMBOL_FLAG_SMALL (flags 0x6 vs 0x2) is somehow being missed when -O1 is turned on. Seems

PowerPC small data sections.

2005-06-17 Thread Sergei Organov
Hi, The gcc-2.95.x seems to be the last GCC version that have usable support for small data sections (.sdata .sdata2) on PowerPC, see PRs 9571, 17337(resolved), and finally 21571. As my embedded project heavily relies on the advantages of using small data sections, it makes it impossible for me