This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Make CSE path following use the CFG


> My guess is that it's another behind-the-back change of a may-trap
> insn into a non-trapping insn.

Confirmed, testcase attached, compile p.adb at -O -mtune=pentium.

(insn 13 12 14 2 (set (reg:SF 62)
        (mem/u/c/i:SF (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [0 S4 A32])) 59 
{*movsf_1} (nil)
    (expr_list:REG_EQUAL (const_double:SF -2147483648 [0x80000000] 1.0e+0 
[0x0.8p+1])
        (nil)))

(insn 14 13 78 2 (set (reg:DF 63)
        (float_extend:DF (reg:SF 62))) 86 {*extendsfdf2_i387} (nil)
    (expr_list:REG_EH_REGION (const_int 1 [0x1])
        (nil)))

is turned into

(insn 14 13 78 2 (set (reg:DF 63)
        (float_extend:DF (reg:SF 62))) 86 {*extendsfdf2_i387} (nil)
    (expr_list:REG_EQUAL (const_double:DF -2147483648 [0x80000000] 1.0e+0 
[0x0.8p+1])
        (expr_list:REG_EH_REGION (const_int 1 [0x1])
            (nil))))

and the latter doesn't trap because of the new REG_EQUAL note.

-- 
Eric Botcazou
package Q is

   type Complex is record
      Re, Im : Long_Float;
   end record;

   function Compose_From_Cartesian (Re, Im : Long_Float) return Complex;

end Q;
with Q; use Q;

package P is

   function Sqrt (X : Complex) return Complex;

end P;
package body P is

   function Sqrt (X : Complex) return Complex is
   begin
      return Compose_From_Cartesian (1.0, 1.0);
   exception
      when Constraint_Error =>
         return Compose_From_Cartesian (1.0, 1.0);
   end Sqrt;

end P;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]