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]
Other format: [Raw text]

Re: target/5828: gcc-3.0.4 on arm : floating point registers incorrectly reloaded


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

Following testprogram can be used to verify

Try with :
g++ -Wall -O float-reload-jdo-1.cpp
./a.out
g++ -Wall -O2 float-reload-jdo-1.cpp
./a.out
g++ -Wall -O3 float-reload-jdo-1.cpp
./a.out



********* float-reload-jdo-1.cpp - begin ***********
// float-reload-jdo-1.cpp
#include <stdio.h>

extern void* do_something(int s) throw(int);
extern void* do_something_else(int s) throw(int);
extern double getADouble(int i);

int main(int argc, char* argv[])
{
   double d0,d1,d2,d3,d4,d5,d6,d7;
   int i=0;

   d0=getADouble(i++);
   d1=getADouble(i++);
   d2=getADouble(i++);
   d3=getADouble(i++);
   d4=getADouble(i++);
   d5=getADouble(i++);
   d6=getADouble(i++);
   d7=getADouble(i++);

   do_something(1);


   if(d0 != getADouble(0)) return -1;
   if(d1 != getADouble(1)) return -1;
   if(d2 != getADouble(2)) return -1;
   if(d3 != getADouble(3)) return -1;
   if(d4 != getADouble(4)) return -1;
   if(d5 != getADouble(5)) return -1;
   if(d6 != getADouble(6)) return -1;
   if(d7 != getADouble(7)) return -1;

   printf("ok\n");
   return 0;
}


double getADouble(int i)
{
   const double list[8] = { 123.333, 126.784353, 203.03415, 220.6234605, 0.000134315123, 9384.239451, 1239487157834, 9328432.234 };

   return list[i];
}

void* do_something(int s) throw(int)
{
   return do_something_else(s);
}

void* do_something_else(int s) throw(int)
{
   switch(s) {
   case 0:
     return 0;
   case 1:
     return (void*)1;
   default:
     throw s;
   }
}


********* float-reload-jdo-1.cpp - end ***********




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