https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65709

--- Comment #4 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
If you change:

4309 static void LZ4_copy8(void* dstPtr, const void* srcPtr)                    
4310 {                                                                          
4311                                                                            
4312     if (1)                                                                 
4313     {                                                                      
4314         if (LZ4_64bits())                                                  
4315             *(U64*)dstPtr = *(U64*)srcPtr;                                 
4316         else                                                               
4317             ((U32*)dstPtr)[0] = ((U32*)srcPtr)[0],                         
4318             ((U32*)dstPtr)[1] = ((U32*)srcPtr)[1];                         
4319         return;                                                            
4320     }                                                                      
4321                                                                            
4322     memcpy(dstPtr, srcPtr, 8);                                             
4323 } 

to if (0) it will work.

And looking at the lz4 git repository I see:

 269 static void LZ4_copy8(void* dstPtr, const void* srcPtr)                    
 270 {                                                                          
 271 #if GCC_VERSION!=409  /* disabled on GCC 4.9, as it generates invalid
opcode (crash) */                                                               
 272     if (LZ4_UNALIGNED_ACCESS)                                              
 273     {                                                                      
 274         if (LZ4_64bits())                                                  
 275             *(U64*)dstPtr = *(U64*)srcPtr;                                 
 276         else                                                               
 277             ((U32*)dstPtr)[0] = ((U32*)srcPtr)[0],                         
 278             ((U32*)dstPtr)[1] = ((U32*)srcPtr)[1];                         
 279         return;                                                            
 280     }                                                                      
 281 #endif                                                                     
 282     memcpy(dstPtr, srcPtr, 8);                                             
 283 }

Reply via email to