fix tree-opt/22022

Laurent GUERBY laurent@guerby.net
Fri Jun 17 11:38:00 GMT 2005


The tree_split_edge ICE is gone, two tests (cxg1001 cxg1002) are now PASS but
new kind of ICEs have popped up. Will file new PRs tonight after work.

Patch from http://gcc.gnu.org/ml/gcc-patches/2005-06/msg01327.html
is still enough to bootstrap Ada.

Thanks for the fix,

Laurent

1/ "memory store"

/home/guerby/work/gcc/build/build-20050617T085204/gcc/xgcc -c -B/home/guerby/work/gcc/build/build-20050617T085204/gcc/ -gnatws -O2 -I/home/guerby/work/gcc/build/build-20050617T085204/gcc/testsuite/ada/acats/support cxg1003.adb
cxg1003.adb: In function 'CXG1003':
cxg1003.adb:63: error: Statement makes a memory store, but has no V_MAY_DEFS nor V_MUST_DEFS
IMAGPART_EXPR <tc_complex_507> = SR.373_64;
+===========================GNAT BUG DETECTED==============================+
| 4.1.0 20050617 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
| verify_ssa failed.                                                       |
| Error detected at cxg1003.adb:478:5                                      |

/home/guerby/work/gcc/build/build-20050617T085204/gcc/xgcc -c -B/home/guerby/work/gcc/build/build-20050617T085204/gcc/ -gnatws -O2 -I/home/guerby/work/gcc/build/build-20050617T085204/gcc/testsuite/ada/acats/support cxg2007.adb
cxg2007.adb: In function 'CXG2007':
cxg2007.adb:68: error: Statement makes a memory store, but has no V_MAY_DEFS nor V_MUST_DEFS
IMAGPART_EXPR <z_523> = SR.460_62;
+===========================GNAT BUG DETECTED==============================+
| 4.1.0 20050617 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
| verify_ssa failed.                                                       |
| Error detected at cxg2007.adb:291:5                                      |

2/ tree-ssa-loop-im

/home/guerby/work/gcc/build/build-20050617T085204/gcc/xgcc -c -B/home/guerby/work/gcc/build/build-20050617T085204/gcc/ -gnatws -O2 -I/home/guerby/work/gcc/build/build-20050617T085204/gcc/testsuite/ada/acats/support cxg2018.adb
+===========================GNAT BUG DETECTED==============================+
| 4.1.0 20050617 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
| in for_each_index, at tree-ssa-loop-im.c:219                             |
| Error detected at cxg2018.adb:355:5                                      |



On Thu, 2005-06-16 at 17:58 -0700, Richard Henderson wrote:
> The comment pretty much says it all.  Tested (with some difficulty
> due to prevailing conditions) on i686-linux.
> 
> 
> r~
> 
> 
>         * tree-complex.c (update_phi_components): Avoid no-op moves.
> 
> Index: tree-complex.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/tree-complex.c,v
> retrieving revision 2.29
> diff -u -p -d -r2.29 tree-complex.c
> --- tree-complex.c	16 Jun 2005 18:09:34 -0000	2.29
> +++ tree-complex.c	17 Jun 2005 00:53:06 -0000
> @@ -577,6 +577,12 @@ update_phi_components (basic_block bb)
>  	    tree arg = PHI_ARG_DEF (phi, i);
>  	    tree r, i;
>  
> +	    /* Avoid no-op assignments.  This also prevents insertting stmts
> +	       onto abnormal edges, assuming the PHI isn't already broken.  */
> +	    if (TREE_CODE (arg) == SSA_NAME
> +		&& SSA_NAME_VAR (arg) == SSA_NAME_VAR (lhs))
> +	      continue;
> +
>  	    r = extract_component (NULL, arg, 0, false);
>  	    i = extract_component (NULL, arg, 1, false);
>  	    update_complex_components_on_edge (e, NULL, lhs, r, i);
> Index: testsuite/g++.dg/opt/complex2.C
> ===================================================================
> RCS file: testsuite/g++.dg/opt/complex2.C
> diff -N testsuite/g++.dg/opt/complex2.C
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ testsuite/g++.dg/opt/complex2.C	17 Jun 2005 00:53:06 -0000
> @@ -0,0 +1,24 @@
> +// PR 22022
> +// { dg-do compile }
> +// { dg-options "-O2" }
> +
> +_Complex float f();
> +_Complex float g();
> +_Complex float h()throw();
> +void i(_Complex float)throw();
> +
> +void j(void)
> +{
> +  _Complex float x = h();
> +  try
> +  {
> +    try
> +    {
> +      x = f();
> +    }catch (...)
> +    {
> +      x = g();
> +    }
> +  }catch(...){}
> +  i(x);
> +}
> Index: testsuite/g++.dg/opt/complex3.C
> ===================================================================
> RCS file: testsuite/g++.dg/opt/complex3.C
> diff -N testsuite/g++.dg/opt/complex3.C
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ testsuite/g++.dg/opt/complex3.C	17 Jun 2005 00:53:06 -0000
> @@ -0,0 +1,24 @@
> +// PR 22022
> +// { dg-do compile }
> +// { dg-options "-O2" }
> +
> +_Complex float f();
> +_Complex float g();
> +_Complex float h()throw();
> +void i(float)throw();
> +
> +float j(void)
> +{
> +  _Complex float x = h();
> +  try
> +  {
> +    try
> +    {
> +      x = f();
> +    }catch (...)
> +    {
> +      x += g();
> +    }
> +  }catch(...){}
> +  i(__builtin_crealf(x)+__builtin_cimagf(x));
> +}
> 



More information about the Gcc-patches mailing list