Message ID | 201207181654.16090.ebotcazou@adacore.com |
---|---|
State | New |
Headers | show |
On Wed, Jul 18, 2012 at 4:54 PM, Eric Botcazou <ebotcazou@adacore.com> wrote: > This is a regression present on mainline and 4.7 branch for targets using SJLJ > exceptions by default in Ada (e.g. ARM). The error message is: > > Unable to coalesce ssa_names 2 and 20 which are marked as MUST COALESCE. > b1_2(ab) and b1_20(ab) > +===========================GNAT BUG DETECTED==============================+ > | 4.8.0 20120716 (experimental) [trunk revision 189525] (x86_64-suse-linux) GCC > error:| > | SSA corruption | > | Error detected around p.adb:4:1 > > It's the usual case of overlapping live ranges for (ab) SSA names. > > Tested on x86_64-suse-linux, OK for the mainline and 4.7 branch? Ok. Thanks, Richard. > > 2012-07-18 Eric Botcazou <ebotcazou@adacore.com> > > * tree-ssa-forwprop.c (combine_conversions): Punt if the RHS of the > defining statement is a SSA name that occurs in abnormal PHIs. > > > 2012-07-18 Eric Botcazou <ebotcazou@adacore.com> > > * gnat.dg/aggr20.ad[sb]: New test. > * gnat.dg/aggr20_pkg.ads: New helper. > > > -- > Eric Botcazou
Index: tree-ssa-forwprop.c =================================================================== --- tree-ssa-forwprop.c (revision 189525) +++ tree-ssa-forwprop.c (working copy) @@ -2584,6 +2584,11 @@ combine_conversions (gimple_stmt_iterato unsigned int final_prec = TYPE_PRECISION (type); int final_unsignedp = TYPE_UNSIGNED (type); + /* Don't propagate ssa names that occur in abnormal phis. */ + if (TREE_CODE (defop0) == SSA_NAME + && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (defop0)) + return 0; + /* In addition to the cases of two conversions in a row handled below, if we are converting something to its own type via an object of identical or wider precision, neither