view gcc/testsuite/g++.dg/tree-ssa/pr20963.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-O2" } */

/* This was causing PRE to insert the value of the ADDR variable, to 
   remove the invariant cast but in doing so, it was creating a 
   non-invariant expression out of the invariant one, causing a later 
   failure in PRE.  */ 
struct sMCB { 
  unsigned char type; 
}; 
 
extern void foo (void); 
unsigned char mem_readb(char *pt) __attribute__((nothrow)); 
 
void DOS_FreeProcessMemory(unsigned short pspseg) { 
        while (1) { 
                if (pspseg) 
                        foo (); 
                char *addr = (char*)(&((sMCB*)0)->type); 
                if (mem_readb(addr)==0x5a) break; 
        } 
};