This is the mail archive of the gcc-patches@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: [Committed] PR middle-end/18548: RTL expansion of MAX_EXPR



On Dec 18, 2004, at 10:20 AM, Steven Bosscher wrote:


On Saturday 18 December 2004 14:12, Roger Sayle wrote:
This patch resolves PR middle-end/18548 which is a wrong-code regression
on mainline.

Could this bug also be present in older GCCs? I was thinking about the g++ min/max extension, e.g. "a = (a+1) >? b;".

Here is a testcase for at least 3.3.2 and c++: long fff[10];

extern "C" void abort (void);

long f(long a, long b)
{
  int i;
  a =  *((long*)(a+5))>?*((long*)(a+1));
  for(i=0;i<10;i++)
   fff[i] = a;
}

int main(void)
{
  int i;
  long a[2] = {10,5};
  f((long)(&a)-1,0);
  for(i = 0;i<10;i++)
   if (fff[i]!=10)
    abort ();
}

Thanks,
Andrew Pinski


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