<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>430485</bug_id>
          
          <creation_ts>2020-12-16 22:43:10 +0000</creation_ts>
          <short_desc>expr_is_guardable doesn&apos;t handle Iex_Qop</short_desc>
          <delta_ts>2020-12-22 13:57:54 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Developer tools</classification>
          <product>valgrind</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://bugzilla.redhat.com/show_bug.cgi?id=1844910</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Mark Wielaard">mark</reporter>
          <assigned_to name="Julian Seward">jseward</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1985004</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Wielaard">mark</who>
    <bug_when>2020-12-16 22:43:10 +0000</bug_when>
    <thetext>After implementing Iop_MAdd/Sub for arm64 (bug #426014) we got a report that &quot;the impossible happened&quot;:

&gt; MSubF64(t15,t21,t22,t23)
&gt; vex: the `impossible&apos; happened:
&gt;    expr_is_guardable: unhandled expr
&gt; vex storage: T total 3295105024 bytes allocated
&gt; vex storage: P total 0 bytes allocated
&gt; 
&gt; valgrind: the &apos;impossible&apos; happened:
&gt;    LibVEX called failure_exit().

And indeed expr_is_guardable doesn&apos;t handle Iex_Qop the tag IRExpr_Qop uses.
It seems something like the following should work (currently untested):

diff --git a/VEX/priv/guest_generic_bb_to_IR.c b/VEX/priv/guest_generic_bb_to_IR.c
index 0cee970e4..1e72ddacd 100644
--- a/VEX/priv/guest_generic_bb_to_IR.c
+++ b/VEX/priv/guest_generic_bb_to_IR.c
@@ -422,6 +422,8 @@ static Bool expr_is_guardable ( const IRExpr* e )
          return !primopMightTrap(e-&gt;Iex.Binop.op);
       case Iex_Triop:
          return !primopMightTrap(e-&gt;Iex.Triop.details-&gt;op);
+      case Iex_Qop:
+         return !primopMightTrap(e-&gt;Iex.Qop.details-&gt;op);
       case Iex_ITE:
       case Iex_CCall:
       case Iex_Get:

I am just surprised this hasn&apos;t come up before since other arches (ppc, s390) also implement scalar FMA operations.

Some more background in https://bugzilla.redhat.com/show_bug.cgi?id=1844910 (the fedora valgrind package has the arm64 fma patch backported).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987581</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Wielaard">mark</who>
    <bug_when>2020-12-22 13:57:54 +0000</bug_when>
    <thetext>commit 42ef710e1928275c98ff72cd82bc5e6b05fe8295
Author: Mark Wielaard &lt;mark@klomp.org&gt;
Date:   Tue Dec 22 14:51:15 2020 +0100

    expr_is_guardable doesn&apos;t handle Iex_Qop
    
    IRExpr_Qop uses the Iex_Qop tag, which expr_is_guardable didn&apos;t handle.
    
    https://bugs.kde.org/show_bug.cgi?id=430485</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>