[PATCH] IPA: fix reproducibility in IPA MOD REF

Jan Hubicka hubicka@kam.mff.cuni.cz
Thu Nov 18 18:22:12 GMT 2021


> Supported LTO compression algorithms: zlib zstd
> gcc version 12.0.0 20211118 (experimental) (GCC)
> /usr/bin/ld: ./xxx.ltrans0.ltrans.o: warning: relocation against `lm_read_ctl_dict_size_n_lmclass_used' in read-only section `.text'
> /usr/bin/ld: ./xxx.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol `__ckd_calloc___elem_size' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: bad value
> collect2: error: ld returned 1 exit status
> /usr/bin/ld: ./yyy.ltrans0.ltrans.o: warning: relocation against `__ckd_calloc___n_elem' in read-only section `.text'
> /usr/bin/ld: ./yyy.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol `__ckd_calloc___elem_size' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: bad value
> collect2: error: ld returned 1 exit status
> diff: yyy.ltrans0.ltrans*optimized: No such file or directory
> 54,55d53
> < 	movslq	lm_read_ctl_dict_size_n_lmclass_used(%rip), %rax
> < 	movl	$0, 0(%rbp,%rax,4)
> 
> I tracked that it differs in tree DSE dump.
> 
> May I install the patch?

No, I think it is bug of symbol_summary that get is causing a
difference.  It should be pure function. I think it is:
  /* Getter for summary callgraph node pointer.  */
  T* get (cgraph_node *node) ATTRIBUTE_PURE
    {
       return exists (node) ? (*m_vector)[node->get_summary_id ()] : NULL;
    }
It should not be using get_summary_id (which allocates it for no good
reaosn) and simply check that summary_id is non-negative.

Still I wonder how this can make code different - that looks like
another bug somewhere.

Honza


More information about the Gcc-patches mailing list