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]

[Bug optimization/11631] [3.4/3.3-hammer regression] zsh/kernel miscompilation


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11631


zlomek at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rakdver at atrey dot karlin
                   |                            |dot mff dot cuni dot cz
           Keywords|                            |wrong-code


------- Additional Comments From zlomek at gcc dot gnu dot org  2003-07-24 16:14 -------
it is a bug in store motion,
when compiled with "./xgcc -B . -O2 -fno-gcse-sm zsh.c" it works.

BB 1 (see testcase):                          0                                
                                                                               
     
char *arg0 = p;                               |                                
                                                                               
     
if ((p = strrchr(arg0, '/')))                 1 <<                             
                                                                               
     
goto BB3                                     /|  ^                             
                                                                               
     
                                            2 |  ^                             
                                                                                    
BB 2:                                        \|  ^                             
                                                                                   
p = arg0;                                     3 >^                             
                                                                                   
                                              |                                
                                                                               
     
BB 3:                                         4                                
                                                                               
     
if (strcmp(p, "bar") == 0)                                                     
                                                                               
     
 goto BB1;                                                                     
                                                                               
     
                                                                               
                                                                               
     
BB 4:                                                                          
                                                                               
     
  f(p);                                                                        
                                                                               
     
  g(p);                                                                        
                                                                               
     
                                                                               
                                                                               
     
The store to p in BB1 is replaced by store to a pseudoreg.                     
                                                                               
       
In front of BB4 the pseudoreg is stored to p.                                  
                                                                               
     
The problem is that when we store to p in BB 2                                 
                                                                               
     
it will be replaced in BB 4 by the pseudoreg (result of strrchr, which is 0).  
                                                                               
                          
I think the store to p in BB 2 should be replaced with a store to the same     
                                                                               
     
pseudoreg too.


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