Topic: 1/3 - Some C/C++ Optimization Idioms I Wish Compilers Supported
Author: kuyper@wizard.net ("James Kuyper Jr.")
Date: Wed, 6 Nov 2002 01:06:30 +0000 (UTC) Raw View
Allan W wrote:
> andys@evo6.com.NoSpam (Andy Sawyer) wrote
>
>> junkmacc1@hotmail.com ("Willow Schlanger (junkmacc1)") wrote:
>>[quoting elided due to copyright notice]
>>
>>You say "many compilers" miss these optimisations, yet you cite only 2
>>examples (Borland, g++). I submit that "two" is not "many".
>
>
> In common English usage, "many" means "a large number."
> But in Computer Science, "many" often means "more than one."
> i.e. relational databases support either "1:1" or "1:many" relationships.
Unfortunately, the context implies the ordinary english usage, not the
specialized computer science usage.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: not-a-real-address@usa.net (those who know me have no need of my name)
Date: Mon, 4 Nov 2002 09:41:55 +0000 (UTC) Raw View
in comp.lang.c i read:
>- This is part 1 of 3 of the posting with subject "Some C/C++
>Optimization Idioms I Wish Compilers Supported," dated Oct 28, 2002.
take it to appropriate groups. none of the groups to which you posted are
appropriate.
--
bringing you boring signatures for 17 years
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: esben@despammed.com (Esben Mose Hansen)
Date: Tue, 5 Nov 2002 00:43:16 +0000 (UTC) Raw View
Willow Schlanger (junkmacc1) wrote:
Moderators: If somebody has already posted this experiment under g++,
please feel free to bounce this post.
[... cutting copyrighted post ...]
I can't reproduce your test on g++, even though you state that you know
this compiler produce this behaviour. This is my results; I cannot see
any string copies in this:
Test program:
struct s {
s() {
x[0]=0;
}
char x[1024];
};
extern s g() {
s y;
y.x[0] = 'c';
y.x[1] = '\0';
return y;
}
int main() {
s z = g();
return 0;
}
Compile command:
g++ -O2 -S test.cpp
Result:
.file "test.cpp"
.text
.align 2
.p2align 4,,15
.globl _Z1gv
.type _Z1gv,@function
_Z1gv:
.LFB1:
pushl %ebp
.LCFI0:
movl %esp, %ebp
.LCFI1:
movl 8(%ebp), %eax
movb $99, (%eax)
movb $0, 1(%eax)
popl %ebp
ret $4
.LFE1:
.Lfe1:
.size _Z1gv,.Lfe1-_Z1gv
.align 2
.p2align 4,,15
.globl main
.type main,@function
main:
.LFB2:
pushl %ebp
.LCFI2:
movl %esp, %ebp
.LCFI3:
subl $1048, %esp
.LCFI4:
leal -1032(%ebp), %eax
andl $-16, %esp
movl %eax, (%esp)
call _Z1gv
xorl %eax, %eax
subl $4, %esp
movl %ebp, %esp
popl %ebp
ret
.LFE2:
.Lfe2:
.size main,.Lfe2-main
.ident "GCC: (GNU) 3.2"
--
Furthermore, a good chunk of his theory is untestable metaphysics,
psychobabble and gobbledygook.
http://skepdic.com/backmess.html
-=-=-
... 'But it'll kill him!'
It could be worse,' said Rincewind.
'What?'
'It could be us, ' Rincewind pointed out logically. (Terry Pratchet)
* TagZilla 0.030
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: first.last@company.com (Default User)
Date: Tue, 5 Nov 2002 18:34:39 +0000 (UTC) Raw View
Martin Dickopp wrote:
> The copyright notice in your posting, which prohibits distribution of
> modified versions, makes it illegal to quote parts of your posting.
> This makes it practically impossible to reply at all. I can therefore
> only assume that you are not interested in comments.
Some info on copyrights.
1. Everything that is unique and fixed in a final form is copyrighted
(for nations signatory to the Berne convention, which is most). The
attachment of a copyright statement to a usenet post does not make it
copyrighted, it already was.
2. Copyright statements cannot restrict use more than the copyright laws
already provide. Additional statements allowing greater latitude for use
can be attached, these are licenses for use. You can make it less
restrictive, not more.
3. The fair use exemptions to the copyright laws exist, and this is what
allows one to reply quote a usenet post. An excerpt of the work, for
noncommercial purposes, for the reasons of commentary or criticism is
allowed, and has a vast body of prior use on usenet.
The fact that the OP attached that copyright statement in no way
affected anyone's rights to quote her post. It's just as legal or
illegal to quote hers as anyone elses. I know some of you realize that
and were making a joke by explicitly not quoting, but this is in case
some people are confused.
Brian Rodenborn
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: first.last@company.com (Default User)
Date: Tue, 5 Nov 2002 21:33:59 +0000 (UTC) Raw View
===================================== MODERATOR'S COMMENT:
Further discussion of copyright laws should be taken
to a more suitable forum.
===================================== END OF MODERATOR'S COMMENT
Andy Sawyer wrote:
> 4. The copyright laws in your jurisdiction may differ from those in
> the poster's jurisdiction, or in the jurisdiction of any follow-up
> poster and therefore some (or all) of your points may not apply.
Not really. The copyright laws are pretty uniform these days, due to the
Berne convention. Read about it here:
http://www.law.cornell.edu/treaties/berne/overview.html
The vast majority of nations that are likely to be involved with these
posts are signatory to this.
Brian Rodenborn
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: terekhov@web.de (Alexander Terekhov)
Date: Tue, 5 Nov 2002 23:34:13 +0000 (UTC) Raw View
Default User wrote:
>
> ===================================== MODERATOR'S COMMENT:
> Further discussion of copyright laws should be taken
> to a more suitable forum.
I just like to add... More info on the subject of:
- more suitable forum;
- "crash course on copyrights; limitations on the rights granted by
copyright";
- DMCA and the way how The C/C++ Users Journal [http://www.cuj.com]
uses it;
- upcoming C++0x *standardization WRT threading*;
can be found in the follow-up {written by me} to this c.l.c++ article:
http://groups.google.com/groups?selm=Xns92AE4F1878985andreincognitocom%40209.53.75.21
(Subject: Re: I need a reccomendation of good C++ magazine. Thanks in advance.)
regards,
alexander.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]