public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/7888: wrong code produced by GCC 3.1
@ 2002-09-12  5:42 nathan
  0 siblings, 0 replies; 7+ messages in thread
From: nathan @ 2002-09-12  5:42 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, tabasso

Synopsis: wrong code produced by GCC 3.1

State-Changed-From-To: feedback->closed
State-Changed-By: nathan
State-Changed-When: Thu Sep 12 05:42:11 2002
State-Changed-Why:
    With a power pc 3.2 compiler the unoptimized code looks like
    ...
    addi 10,31,16
            lwz 9,0(10)
            mr 11,9
            lwz 7,32(31)
            lwz 8,36(31)
            stw 7,0(11)
            stw 8,4(11)
            addi 9,9,8
            stw 9,0(10)
    ..
    which looks correct for a single *dbplp++
    the optimised loop looks like
    .L13:
            stw 9,0(3)
            stw 10,4(3)
            stwu 9,8(3)
            stw 10,4(3)
            stwu 9,8(3)
            stw 10,4(3)
            stwu 9,8(3)
            stw 10,4(3)
            addi 3,3,8
            bdnz .L13
            mr 11,3
    
    which again looks correct.
    
    If the problem persists, please provide
    the target triplet, a *complete* code sample, and
    indicate in the assembly where the error is, if possible.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7888


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

* Re: c/7888: wrong code produced by GCC 3.1
@ 2002-09-16  0:56 Nathan Sidwell
  0 siblings, 0 replies; 7+ messages in thread
From: Nathan Sidwell @ 2002-09-16  0:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/7888; it has been noted by GNATS.

From: Nathan Sidwell <nathan@codesourcery.com>
To: Andrew Pinski <pinskia@physics.uc.edu>
Cc: Raul Tabasso <tabasso@tabasoft.it>, nathan@gcc.gnu.org,
   gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org,
   gcc-gnats@gcc.gnu.org
Subject: Re: c/7888: wrong code produced by GCC 3.1
Date: Mon, 16 Sep 2002 08:53:43 +0100

 Andrew Pinski wrote:
 > I could not reproduce your error: I am using gcc version: `Apple  
 > Computer, Inc. GCC version 1161, based on gcc version 3.1 20020420  
 > (prerelease)'
 > Also `Apple Computer, Inc. GCC version 1200, based on gcc version 3.3  
 > 20020824 (experimental)' (apple's Darwin -Head code).
 > And `gcc version 3.3 20020911 (experimental)' (fsf cvs code).
 I suggest you report the problem to Apple. This is not an FSF release,
 and it appears that the current fsf tree does not have the bug.
 
 nathan
 
 -- 
 Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
           'But that's a lie.' - 'Yes it is. What's your point?'
 nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
 
 


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

* Re: c/7888: wrong code produced by GCC 3.1
@ 2002-09-15 17:56 Andrew Pinski
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Pinski @ 2002-09-15 17:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/7888; it has been noted by GNATS.

From: Andrew Pinski <pinskia@physics.uc.edu>
To: Raul Tabasso <tabasso@tabasoft.it>
Cc: nathan@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c/7888: wrong code produced by GCC 3.1
Date: Sun, 15 Sep 2002 17:49:01 -0700

 I could not reproduce your error: I am using gcc version: `Apple  
 Computer, Inc. GCC version 1161, based on gcc version 3.1 20020420  
 (prerelease)'
 Also `Apple Computer, Inc. GCC version 1200, based on gcc version 3.3  
 20020824 (experimental)' (apple's Darwin -Head code).
 And `gcc version 3.3 20020911 (experimental)' (fsf cvs code).
 
 Thanks,
 Andrew Pinski
 
 I used the following program to test your function:
 int main()
 {
 	int i;
 	char  
 temp[]={0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11 
 ,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0 
 x11,0x11,0x11,0x11,0x11};
 	ClearBlock(temp, sizeof(temp));
 	for(i=0;i<sizeof(temp)/sizeof(temp[0]);i++)
 	{
 		if(temp[i]!=0)
 			printf("%d\n",i);
 	}
 	return 0;
 }
 
 
 On Friday, Sep 13, 2002, at 02:51 US/Pacific, Raul Tabasso wrote:
 
 > Use GCC 3.1 (latest version of Apple Developer Tools for MacOSX) and  
 > compile and run.
 >
 > I already provided the source code that produce the error. Just pass a  
 > block filled with 1s to the routine.
 >
 > The routine should clear the block but you will see that only the  
 > first 4 bytes for every double (8 bytes) will set to zeros.
 >
 > best regards
 > Raul Tabasso
 >
 >
 >
 


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

* Re: c/7888: wrong code produced by GCC 3.1
@ 2002-09-13  2:56 Raul Tabasso
  0 siblings, 0 replies; 7+ messages in thread
From: Raul Tabasso @ 2002-09-13  2:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/7888; it has been noted by GNATS.

From: Raul Tabasso <tabasso@tabasoft.it>
To: nathan@gcc.gnu.org,
 gcc-bugs@gcc.gnu.org,
 gcc-prs@gcc.gnu.org,
 nobody@gcc.gnu.org,
 tabasso@tabasoft.it,
 gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c/7888: wrong code produced by GCC 3.1
Date: Fri, 13 Sep 2002 11:51:01 +0200

 Use GCC 3.1 (latest version of Apple Developer Tools for MacOSX) and 
 compile and run.
 
 I already provided the source code that produce the error. Just pass a 
 block filled with 1s to the routine.
 
 The routine should clear the block but you will see that only the first 
 4 bytes for every double (8 bytes) will set to zeros.
 
 best regards
 Raul Tabasso
 


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

* Re: c/7888: wrong code produced by GCC 3.1
@ 2002-09-12  2:36 Raul Tabasso
  0 siblings, 0 replies; 7+ messages in thread
From: Raul Tabasso @ 2002-09-12  2:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/7888; it has been noted by GNATS.

From: Raul Tabasso <tabasso@tabasoft.it>
To: nathan@gcc.gnu.org,
 gcc-bugs@gcc.gnu.org,
 gcc-prs@gcc.gnu.org,
 nobody@gcc.gnu.org,
 tabasso@tabasoft.it,
 gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c/7888: wrong code produced by GCC 3.1
Date: Thu, 12 Sep 2002 11:31:26 +0200

 The processor tested is a Motorola PowerPC G4 but this is not =20
 significative since the code is generated for any of the PowerPC =20
 processor familly.
 
 Mercoled=EC, 11 set 2002, alle 18:01 Europe/Rome, nathan@gcc.gnu.org ha =20=
 
 scritto:
 
 > Synopsis: wrong code produced by GCC 3.1
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: nathan
 > State-Changed-When: Wed Sep 11 09:01:00 2002
 > State-Changed-Why:
 >     what processor?
 >
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview%20audit-=20
 > trail&database=3Dgcc&pr=3D7888
 >
 


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

* Re: c/7888: wrong code produced by GCC 3.1
@ 2002-09-11  9:01 nathan
  0 siblings, 0 replies; 7+ messages in thread
From: nathan @ 2002-09-11  9:01 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, tabasso

Synopsis: wrong code produced by GCC 3.1

State-Changed-From-To: open->feedback
State-Changed-By: nathan
State-Changed-When: Wed Sep 11 09:01:00 2002
State-Changed-Why:
    what processor?

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7888


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

* c/7888: wrong code produced by GCC 3.1
@ 2002-09-11  8:06 tabasso
  0 siblings, 0 replies; 7+ messages in thread
From: tabasso @ 2002-09-11  8:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7888
>Category:       c
>Synopsis:       wrong code produced by GCC 3.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 11 08:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Raul Tabasso
>Release:        gcc 3.1
>Organization:
>Environment:
MacOSX 1.2 with gcc 3.1 compiling with NO -o option
>Description:
The GCC compiler version 3.1 produce wrong code when declaring a register variable of type double. Suppressing the register statement avoids the problem.

The register clause in line: "register double	zero = 0" produce a wrong code when using this register variable in a statement like "*dblP++ = zero;" where "dblP" is a pointer to a double.
The code will clear only the first 4 bytes and NOT 8 as it should be.
>How-To-Repeat:
// Code that cause the bug:
void ClearBlock(void *blockP, int blockSize)
{
register double	zero = 0;
double *dblP = (double*)blockP;
int  step32 = blockSize / (sizeof(double) * 4);
char  *charP(char*)blockP;

if (step32)
{
      blockSize -= step32 * (sizeof(double) * 4);
do {
      *dblP++ = zero;
      *dblP++ = zero;
      *dblP++ = zero;
      *dblP++ = zero;
      } while (--step32);
  charP = (char*)dblP;
 }
if (blockSize)
{
  do {
      *charP++ = 0;
      } while (--blockSize);
}
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-09-16  7:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-12  5:42 c/7888: wrong code produced by GCC 3.1 nathan
  -- strict thread matches above, loose matches on Subject: below --
2002-09-16  0:56 Nathan Sidwell
2002-09-15 17:56 Andrew Pinski
2002-09-13  2:56 Raul Tabasso
2002-09-12  2:36 Raul Tabasso
2002-09-11  9:01 nathan
2002-09-11  8:06 tabasso

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