This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: inline-analysis improvement
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, mjambor at suse dot cz
- Date: Fri, 16 Sep 2011 16:41:10 +0200
- Subject: Re: inline-analysis improvement
- References: <20110915102759.GG13389@kam.mff.cuni.cz>
> * ipa-inline-analysis.c (add_condition): Add conditions parameter;
> simplify obviously true clauses.
> (and_predicates, or_predicates): Add conditions parameter.
> (inline_duplication_hoook): Update.
> (mark_modified): New function.
> (unmodified_parm): New function.
> (eliminated_by_inlining_prob, (set_cond_stmt_execution_predicate,
> set_switch_stmt_execution_predicate, will_be_nonconstant_predicate):
> Use unmodified_parm.
> (estimate_function_body_sizes): Update.
> (remap_predicate): Update.
This breaks things in Ada:
Program received signal SIGSEGV, Segmentation fault.
walk_aliased_vdefs_1 (ref=0xffffcbf4, vdef=0x0,
walker=0x873e3e0 <mark_modified>, data=0xffffcc1f, visited=0xffffcbc0,
cnt=0) at /home/eric/svn/gcc/gcc/tree-ssa-alias.c:1996
1996 gimple def_stmt = SSA_NAME_DEF_STMT (vdef);
(gdb) bt
#0 walk_aliased_vdefs_1 (ref=0xffffcbf4, vdef=0x0,
walker=0x873e3e0 <mark_modified>, data=0xffffcc1f, visited=0xffffcbc0,
cnt=0) at /home/eric/svn/gcc/gcc/tree-ssa-alias.c:1996
#1 0x089c3a6d in walk_aliased_vdefs (ref=0xffffcbf4, vdef=0x0,
walker=0x873e3e0 <mark_modified>, data=0xffffcc1f, visited=0xffffcbc0)
at /home/eric/svn/gcc/gcc/tree-ssa-alias.c:2037
#2 0x087456b5 in unmodified_parm (stmt=0xf7cf6ab0, op=0xf7cf77e0)
at /home/eric/svn/gcc/gcc/ipa-inline-analysis.c:1104
#3 0x08748a99 in eliminated_by_inlining_prob (stmt=<optimized out>)
at /home/eric/svn/gcc/gcc/ipa-inline-analysis.c:1165
Testcase attached, compile it at -O on x86/x86-64. It can also be directly
installed as gnat.dg/opt19.adb in the testsuite.
--
Eric Botcazou
-- { dg-do compile }
-- { dg-options "-O" }
procedure Opt19 is
type Enum is (One, Two);
type Vector_T is array (Enum) of Integer;
Zero_Vector : constant Vector_T := (Enum => 0);
type T is record
Vector : Vector_T;
end record;
procedure Nested (Value : in out T; E : Enum; B : out Boolean) is
I : Integer renames Value.Vector(E);
begin
B := I /= 0;
end;
Obj : T := (Vector => Zero_Vector);
B : Boolean;
begin
Nested (Obj, One, B);
end;