Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: AMD64
Re: Re: GCC-4.5.2 Has Serious Problems
 

Index | Next | Previous | View Flat


ianmcc at physics

Jun 30, 2011, 7:15 PM


Views: 2731
Permalink
Re: Re: GCC-4.5.2 Has Serious Problems [In reply to]

On Fri, 1 Jul 2011, Frank Peters wrote:

> On Fri, 1 Jul 2011 00:58:46 +0000 (UTC)
> Duncan <1i5t5.duncan [at] cox> wrote:
>
>>
>> I had wondered if this might be an "undefined behavior" optimization bug,
>>
>
> Well, the amd64 users list may not be the appropriate place to discuss
> C programming, but the problem here stems from attempting to do things
> with C that are not supposed to be done with C. Such things are aptly
> called "tricks" because they stray away from the convention.

I don't think that is true - C has ALWAYS had rules on strict aliasing,
even from the first attempts at standardization.

Unfortunately it is only recently that common compilers and hardware have
really taken advantage of the way the language works to give better
optimizing performance by storing more variables in registers rather than
reloading pointers from memory every time. Mostly this is due to the
small number of registers in the x86 architecture, doesn't lend itself to
these optimisations as well as other architectures. Contrast with Itanium
for example with lots of registers, some of which are designed to be
preserved across a function call. FORTRAN compilers have taken advantage
of aliasing optimizations right from the beginning (ie, since the
1960's!), and commodity C compilers are only now just catching up! So
these are hardly new optimizations.

>
> Ideally, I suppose, for these purposes would be to use assembly language
> routines mixed into the C code. But this is not as easy as with the
> "tricks."

Not at all, it is about producing more efficient assembly, using the
language rules that have existed practically forever. If programmers have
become accustomed to violating those rules, then they'll just have to get
accustomed to not violating them. The rules aren't hard! And if you DO
want to alias pointers of different types, then there are well-defined
ways of doing that, and the resulting code tends to be much more readable
too.

Regards,
Ian

Subject User Time
GCC-4.5.2 Has Serious Problems frank.peters at comcast Jun 30, 2011, 2:45 PM
    Re: GCC-4.5.2 Has Serious Problems wonko at wonkology Jun 30, 2011, 3:30 PM
        Re: GCC-4.5.2 Has Serious Problems frank.peters at comcast Jun 30, 2011, 4:34 PM
        Re: Re: GCC-4.5.2 Has Serious Problems ianmcc at physik Jun 30, 2011, 7:30 PM
    Re: GCC-4.5.2 Has Serious Problems realnc at arcor Jun 30, 2011, 4:35 PM
        Re: GCC-4.5.2 Has Serious Problems realnc at arcor Jun 30, 2011, 4:44 PM
            Re: Re: GCC-4.5.2 Has Serious Problems frank.peters at comcast Jun 30, 2011, 5:04 PM
                Re: GCC-4.5.2 Has Serious Problems realnc at arcor Jun 30, 2011, 5:11 PM
                    Re: GCC-4.5.2 Has Serious Problems 1i5t5.duncan at cox Jun 30, 2011, 5:58 PM
                        Re: Re: GCC-4.5.2 Has Serious Problems frank.peters at comcast Jun 30, 2011, 6:23 PM
                            Re: GCC-4.5.2 Has Serious Problems 1i5t5.duncan at cox Jun 30, 2011, 6:52 PM
                            Re: Re: GCC-4.5.2 Has Serious Problems ianmcc at physics Jun 30, 2011, 7:15 PM
                            Re: Re: GCC-4.5.2 Has Serious Problems markknecht at gmail Jun 30, 2011, 9:36 PM
                                Re: Re: GCC-4.5.2 Has Serious Problems frank.peters at comcast Jun 30, 2011, 10:22 PM
            Re: Re: GCC-4.5.2 Has Serious Problems frank.peters at comcast Jun 30, 2011, 5:25 PM
            Re: Re: GCC-4.5.2 Has Serious Problems frank.peters at comcast Jun 30, 2011, 6:04 PM
                Re: GCC-4.5.2 Has Serious Problems 1i5t5.duncan at cox Jun 30, 2011, 7:18 PM
                Re: Re: GCC-4.5.2 Has Serious Problems chemoelectric at chemoelectric Jun 30, 2011, 7:22 PM
                    Re: Re: GCC-4.5.2 Has Serious Problems frank.peters at comcast Jun 30, 2011, 7:43 PM
                Re: GCC-4.5.2 Has Serious Problems realnc at arcor Jul 1, 2011, 4:53 AM
                    Re: Re: GCC-4.5.2 Has Serious Problems frank.peters at comcast Jul 1, 2011, 9:53 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.