> On Thu, Dec 19, 2019 at 04:01:31PM +0100, Jan Hubicka wrote:
> > I now get build failure of Firefox with LTO due to:
> > 
> > movabsq $.LC12, %rax
> > 
> > which is output by:
> > 
> > (insn:TI 468 3 849 2 (parallel [                                            
> >     
> >             (set (mem/v/f/c:DI (plus:DI (reg/f:DI 6 bp)                     
> >     
> >                         (const_int -56 [0xffffffffffffffc8])) [1 D.22910+0 
> > S8 A64])
> >                 (unspec:DI [                                                
> >     
> >                         (mem/v/f:DI (const_int 40 [0x28]) [0 
> > MEM[(<address-space-1> long unsigned int *)40B]+0 S8 A64 AS1])
> >                     ] UNSPEC_SP_SET))                                       
> >     
> >             (set (reg:DI 0 ax [157])                                        
> >     
> >                 (symbol_ref/f:DI ("*.LC12") [flags 0x2]  <var_decl 
> > 0x7ffff56ac870 *.LC12>))
> >             (clobber (reg:CC 17 flags))                                     
> >     
> >         ]) 1042 {*stack_protect_set_3}                                      
> >     
> >      (expr_list:REG_UNUSED (reg:CC 17 flags)                                
> >     
> >         (nil)))                                                             
> >     
> > 
> > I suppose we need to be more careful about the symbolic operands for
> > movabs?
> 
> Is that -fPIC or -fPIE or -fno-pic?
> What were the two insns before peephole2?
It is -fPIC transforming

(insn 9 7 12 2 (parallel [                                                      
            (set (mem/v/f/c:DI (plus:DI (reg/f:DI 6 bp)                         
                        (const_int -56 [0xffffffffffffffc8])) [1 D.22910+0 S8 
A64])
                (unspec:DI [                                                    
                        (mem/v/f:DI (const_int 40 [0x28]) [0 
MEM[(<address-space-1> long unsigned int *)40B]+0 S8 A64 AS1])
                    ] UNSPEC_SP_SET))                                           
            (set (reg:DI 0 ax [157])                                            
                (const_int 0 [0]))                                              
            (clobber (reg:CC 17 flags))                                         
        ]) 
"/aux/hubicka/firefox2019-trunktest/dist/include/testing/gtest/include/gtest/gtest.h":1538:17
 1039 {stack_protect_set_1_di}
     (expr_list:REG_UNUSED (reg:CC 17 flags)                                    
        (expr_list:REG_UNUSED (reg:DI 0 ax [157])                               
            (nil))))                                                            
 
(note 12 9 13 2 NOTE_INSN_DELETED)                                              
(insn 13 12 426 2 (set (reg:DI 0 ax [159])                                      
        (symbol_ref/f:DI ("*.LC12") [flags 0x2]  <var_decl 0x7ffff56ac870 
*.LC12>)) 66 {*movdi_internal}
     (nil))                                                                     

to

(insn 468 7 426 2 (parallel [                                                   
            (set (mem/v/f/c:DI (plus:DI (reg/f:DI 6 bp)                         
                        (const_int -56 [0xffffffffffffffc8])) [1 D.22910+0 S8 
A64])
                (unspec:DI [                                                    
                        (mem/v/f:DI (const_int 40 [0x28]) [0 
MEM[(<address-space-1> long unsigned int *)40B]+0 S8 A64 AS1])
                    ] UNSPEC_SP_SET))                                           
            (set (reg:DI 0 ax [157])                                            
                (symbol_ref/f:DI ("*.LC12") [flags 0x2]  <var_decl 
0x7ffff56ac870 *.LC12>))
            (clobber (reg:CC 17 flags))                                         
        ]) -1                                                                   
     (nil))                                                                     

Outputting the move as RIP relative movq would work.
LC12 is string "s" and has nothing to do with stack protecting.

Reply via email to