This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: c/4389: Improper constant folding


Also note that it fails if the array is "int" or "long" or "float"

It works OK when the array is "double" or "short" or "long long"


Summary:

ok:  double
     long long
     short

bad: float
     int
     long

-Mike


#define N 10000
float matrix[N][N];
void main( void )
{
int i=9999;
matrix[i][i] = (float)random();
printf( "The last element is: %12.10f\n", matrix[i][i] );
printf( "The last element is: %12.10f\n", matrix[N-1][N-1] );
}


On 1 Nov 2001 neil@gcc.gnu.org wrote:

> Date: 1 Nov 2001 21:58:39 -0000
> From: neil@gcc.gnu.org
> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, mac@culver.net,
>      nobody@gcc.gnu.org
> Subject: Re: c/4389: Improper constant folding
>
> Synopsis: Improper constant folding
>
> State-Changed-From-To: open->analyzed
> State-Changed-By: neil
> State-Changed-When: Thu Nov  1 13:58:38 2001
> State-Changed-Why:
>     Confirmed.  Very odd.
>
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4389&database=gcc
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]