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

--- Comment #14 from Martin Liška <marxin at gcc dot gnu.org> ---
Created attachment 47374
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47374&action=edit
Another test-case

I see very similar error since the problematic revision:

$ g++ -O3 -fPIC file*.ii -flto
...
file4.ii:55:724: internal compiler error: Segmentation fault
   55 |       unsigned int AgreedValueLength() const ;  unsigned int
StaticPrivateKeyLength() const ;  unsigned int StaticPublicKeyLength() const ; 
    unsigned int EphemeralPrivateKeyLength() const ;  unsigned int
EphemeralPublicKeyLength() const ;      bool Agree(byte *agreedValue,   const
byte *staticPrivateKey, const byte *ephemeralPrivateKey,   const byte
*staticOtherPublicKey, const byte *ephemeralOtherPublicKey,   bool
validateStaticOtherPublicKey=true) const  {   try   {    const
DL_GroupParameters<Element> &params = GetAbstractGroupParameters();    Element
WW = params.DecodeElement(staticOtherPublicKey, validateStaticOtherPublicKey); 
  Element VV = params.DecodeElement(ephemeralOtherPublicKey, true);    Integer
s(staticPrivateKey, StaticPrivateKeyLength());    Integer
u(ephemeralPrivateKey, StaticPrivateKeyLength());    Element V =
params.DecodeElement(ephemeralPrivateKey+StaticPrivateKeyLength(), false);   
const Integer &r = params.GetSubgroupOrder();    Integer h2 =
Integer::Power2((r.BitCount()+1)/2);    Integer e =
((h2+params.ConvertElementToInteger(V)%h2)*s+u) % r;    Integer tt = h2 +
params.ConvertElementToInteger(VV) % h2;    if (COFACTOR_OPTION::ToEnum() ==
NO_COFACTOR_MULTIPLICTION)    {     Element P = params.ExponentiateElement(WW,
tt);     P = m_groupParameters.MultiplyElements(P, VV);     Element R[2];    
const Integer e2[2] = {r, e};     params.SimultaneousExponentiate(R, P, e2, 2);
    if (!params.IsIdentity(R[0]) || params.IsIdentity(R[1]))      return false;
    params.EncodeElement(false, R[1], agreedValue);    }    else    {     const
Integer &k = params.GetCofactor();     if (COFACTOR_OPTION::ToEnum() ==
COMPATIBLE_COFACTOR_MULTIPLICTION)      e = ModularArithmetic(r).Divide(e, k); 
   Element P = m_groupParameters.CascadeExponentiate(VV, k*e, WW, k*(e*tt%r)); 
   if (params.IsIdentity(P))      return false;     params.EncodeElement(false,
P, agreedValue);    }   }   catch (DL_BadElement &)   {    return false;   }  
return true;  } private:    const DL_GroupParameters<Element> &
GetAbstractGroupParameters() const ;  GroupParameters m_groupParameters; }; 
typedef MQV_Domain<DL_GroupParameters_GFP_DefaultSafePrime> MQV;  }
      |                                                                        
                                                                               
                                                                               
                     ^

0xa15d2f crash_signal
        ../../gcc/toplev.c:328
0x7f4235b4714f ???
       
/usr/src/debug/glibc-2.30-1.2.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0xc61640 decl_assembler_name(tree_node*)
        ../../gcc/tree.c:707
0x825aa5 types_same_for_odr(tree_node const*, tree_node const*)
        ../../gcc/ipa-devirt.c:360
0x84892e ipa_polymorphic_call_context::get_dynamic_type(tree_node*, tree_node*,
tree_node*, gimple*, unsigned int*)
        ../../gcc/ipa-polymorphic-call.c:1803
0xb89cf2 eliminate_dom_walker::eliminate_stmt(basic_block_def*,
gimple_stmt_iterator*)
        ../../gcc/tree-ssa-sccvn.c:5758
0xb8b15d eliminate_dom_walker::before_dom_children(basic_block_def*)
        ../../gcc/tree-ssa-sccvn.c:5917
0xb8b15d eliminate_dom_walker::before_dom_children(basic_block_def*)
        ../../gcc/tree-ssa-sccvn.c:5850
0x1186db5 dom_walker::walk(basic_block_def*)
        ../../gcc/domwalk.c:309
0xb8494b eliminate_with_rpo_vn(bitmap_head*)
        ../../gcc/tree-ssa-sccvn.c:6095
0xb92502 do_rpo_vn
        ../../gcc/tree-ssa-sccvn.c:7240
0xb93180 execute
        ../../gcc/tree-ssa-sccvn.c:7322
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Reply via email to