> I have now applied this variant.

You backported it onto the 8 branch on Friday:

2019-05-03  Richard Biener  <rguent...@suse.de>

        Backport from mainline
[...]
        2019-03-07  Richard Biener  <rguent...@suse.de>

        PR tree-optimization/89595
        * tree-ssa-dom.c (dom_opt_dom_walker::optimize_stmt): Take
        stmt iterator as reference, take boolean output parameter to
        indicate whether the stmt was removed and thus the iterator
        already advanced.
        (dom_opt_dom_walker::before_dom_children): Re-iterate over
        stmts created by folding.

and this introduced a regression for the attached Ada testcase at -O:

Program received signal SIGSEGV, Segmentation fault.
0x000000000102173c in set_value_range (
    vr=0x17747a0 <vr_values::get_value_range(tree_node 
const*)::vr_const_varying>, t=VR_RANGE, min=0x7ffff6c3df78, max=<optimized 
out>, equiv=0x0)
    at /home/eric/svn/gcc-8-branch/gcc/tree-vrp.c:298
298       vr->type = t;

on x86-64 at least.  Mainline and 9 branch are not affected.

-- 
Eric Botcazou
package Opt78 is

   subtype Reasonable is Integer range 1..10;

   type UC (D: Reasonable := 2) is record
      S: String (1 .. D) := "Hi";
   end record;

   type AUC is access all UC;

   procedure Proc (P : UC; Msg : String);

end Opt78;
-- { dg-do compile }
-- { dg-options "-O" }

package body Opt78 is

   procedure Proc (P : UC; Msg : String) is
      Default : UC := (1, "!");
   begin
      if P = Default then
         raise Program_Error;
      else
         raise Constraint_Error;
      end if;
   end;

end Opt78;

Reply via email to