Dear all,
Although I probably shouldn't have been so harsh calling this
"mis-compiling", do you see any chance of back-porting this warning back
into the mainline?
P.S. The rationale of this exercise is of course that the "switch",
being a goto in disguise needs careful attention, just like th
On Tue, 2010-03-02 at 12:26 +0100, Richard Guenther wrote:
> On Tue, Mar 2, 2010 at 12:00 PM, Pjotr Kourzanov
> wrote:
> > On Tue, 2010-03-02 at 10:47 +, Andrew Haley wrote:
> >> On 03/02/2010 10:34 AM, Pjotr Kourzanov wrote:
> >>
> >> >> int duff4_fails(char * dst,const char * src,const size
On Tue, Mar 2, 2010 at 12:00 PM, Pjotr Kourzanov
wrote:
> On Tue, 2010-03-02 at 10:47 +, Andrew Haley wrote:
>> On 03/02/2010 10:34 AM, Pjotr Kourzanov wrote:
>>
>> >> int duff4_fails(char * dst,const char * src,const size_t n)
>> >> {
>> >> const size_t rem=n % 4, a=rem + (!rem)*4;
>> >>
On Tue, 2010-03-02 at 10:47 +, Andrew Haley wrote:
> On 03/02/2010 10:34 AM, Pjotr Kourzanov wrote:
>
> >> int duff4_fails(char * dst,const char * src,const size_t n)
> >> {
> >> const size_t rem=n % 4, a=rem + (!rem)*4;
> >> char * d=dst+=a;
> >> const char * s=src+=a;
> >> /* gcc bu
Peter Kourzanov writes:
> I think the compiler is generating wrong code for duff4_fails() when
> 'case 0' labels the for-loop. It somehow skips the first for-loop
> expression,
If rem != 0 you jump over the init expression, so it is never executed.
Andreas.
--
Andreas Schwab, sch...@redhat.
On 03/02/2010 10:34 AM, Pjotr Kourzanov wrote:
>> int duff4_fails(char * dst,const char * src,const size_t n)
>> {
>> const size_t rem=n % 4, a=rem + (!rem)*4;
>> char * d=dst+=a;
>> const char * s=src+=a;
>> /* gcc bug? dst+=n; */
>>
>> switch (rem) {
>> case 0: for(dst+=n;d>
On Tue, 2010-03-02 at 11:27 +0100, Richard Guenther wrote:
> On Tue, Mar 2, 2010 at 10:38 AM, Peter Kourzanov
> wrote:
> >
> > Hi guys,
> >
> > I have the following variation on Duff's device that seems to
> > mis-compile on all GCC versions I can access within a minute (that
> > is gcc-3.{3,4},
On Tue, 2010-03-02 at 10:24 +, Andrew Haley wrote:
> On 03/02/2010 09:38 AM, Peter Kourzanov wrote:
>
> > I have the following variation on Duff's device that seems to
> > mis-compile on all GCC versions I can access within a minute (that
> > is gcc-3.{3,4}, gcc-4.{1,2,3,4} on x86 and gcc
On Tue, Mar 2, 2010 at 10:38 AM, Peter Kourzanov
wrote:
>
> Hi guys,
>
> I have the following variation on Duff's device that seems to
> mis-compile on all GCC versions I can access within a minute (that
> is gcc-3.{3,4}, gcc-4.{1,2,3,4} on x86 and gcc-4.3.2 on x86_64). The
> symptoms are as foll
On 03/02/2010 09:38 AM, Peter Kourzanov wrote:
> I have the following variation on Duff's device that seems to
> mis-compile on all GCC versions I can access within a minute (that
> is gcc-3.{3,4}, gcc-4.{1,2,3,4} on x86 and gcc-4.3.2 on x86_64). The
> symptoms are as follows:
>
> $ gcc-4.4
10 matches
Mail list logo