This assertion exposes a real issue in LNO. Code updating integer constant WN node is incosistent with WN_CreateIntconst.
In WN *WN_CreateIntconst(OPERATOR opr, TYPE_ID rtype, TYPE_ID desc, INT64 const_val) U4intconstant is truncated to 32 bit value. if (opc == OPC_U4INTCONST) { #ifndef TARG_X8664 /* make sure that 32-bit value is sign-extended */ UINT32 uval = const_val; INT32 sval = uval; WN_const_val(wn) = (INT64) sval; #else WN_const_val(wn) = const_val & 0x0ffffffffLL; #endif while in snl_utils.cxx void Increase_By(WN* wn, INT c, WN* parent, INT kid) switch (opr) { case OPR_INTCONST: WN_const_val(wn) += c; // if wn is U4intconstant, its value maybe negatvie now. break; in attached case wn is U4intconstant 1, c is -4. then U4 intconstant WN node has a vlaue -3. Which trigger the assertion in check TCON. Fix will be when updating intconst for U4, keep the same same semantic as WN_createintconsant. for example in the attached case Before fix DO_LOOP {line: 1/13} IDNAME 0 <3,6,J> INIT U4INTCONST 1 (0x1) I4STID 0 <3,6,J> T<4,.predef_I4,4> {line: 1/13} COMP I4I4LDID 0 <3,6,J> T<4,.predef_I4,4> I4I4LDID 0 <3,2,ORDER> T<4,.predef_I4,4> U4INTCONST -3 (0xfffffffffffffffd) // this constant value cause check_tcon assert. I4ADD I4I4LE INCR will change to DO_LOOP {line: 1/13} IDNAME 0 <3,6,J> INIT U4INTCONST 1 (0x1) I4STID 0 <3,6,J> T<4,.predef_I4,4> {line: 1/13} COMP I4I4LDID 0 <3,6,J> T<4,.predef_I4,4> I4I4LDID 0 <3,2,ORDER> T<4,.predef_I4,4> U4INTCONST 4294967293 (0xfffffffd) I4ADD I4I4LE INCR This change has some issue, it will fails in spec2006/tonto. Not investigate yet. Maybe from huge U4 int constant value. But the checkTcon itself is correct and can report real issues in our code. On Wed, May 4, 2011 at 1:42 PM, Gilmore, Doug <doug.gilm...@amd.com> wrote: > Arggh, sorry I dropped Hui's message with the patch for the fix for this > issue. > > I tried it out and ran our gcc/g++/gfortran sanity tests, which is cobbled > from the tests in the testsuite directory of the GCC 4.2 release. > > I did see one error that I haven't had a chance to investigate: > > $ openf95 -O3 array_constructor_9.f90 > > ### Assertion failure at line 269 of > /scratch/dgilmore/sot-pp2/bd/osprey/../../osprey/common/com/x8664/targ_const.cxx: > ### Compiler Error in file array_constructor_9.f90 during Loop Nest > Optimizer phase: > ### High order word of U4 TCON non zero ffffffff > openf95 INTERNAL ERROR: > /scratch/dgilmore/sot-pp2/bd/local/lib/gcc-lib/x86_64-open64-linux/4.2/be > returned non-zero status 1 > > I attached the test. > > Doug > > > -----Original Message----- > > From: Gilmore, Doug [mailto:doug.gilm...@amd.com] > > Sent: Tuesday, May 03, 2011 4:41 PM > > To: open64-devel@lists.sourceforge.net > > Subject: Re: [Open64-devel] r3574 - in trunk/osprey/common/com: . MIPS > > NVISA SL ia64 loongson ppc32 x8664 > > > > Is anyone looking into this? > > > > It appears to me that the compiler built with debugging is quite > > broken, since wgen42 will assert when compiling the following code: > > > > foo (int); > > > > void bar(void) > > { > > foo(-4); > > } > > > > The problem that when the WHIRL node is created for -4 via: > > > > WN *WN_CreateIntconst(OPERATOR opr, TYPE_ID rtype, TYPE_ID desc, INT64 > > const_val) > > { > > ... > > WN_const_val(wn) = const_val; > > ... > > } > > > > And later the simplifier is called on WN_const_val(wn) to create a > > TCON: > > > > Host_To_Targ(TYPE_ID ty, INT64 v) > > { > > static TCON c; > > > > TCON_clear(c); > > > > switch (ty) { > > ... > > case MTYPE_I4: > > ... > > TCON_ty(c) = ty; > > TCON_I8(c) = v; /* Don't change the upper bits */ > > return c; > > ... > > } > > ... > > } > > > > Unfortunately the changes in r3574 now assert when the upper bits > > are set in 32 bit TCON values. > > > > The changes in r3574 seem right, unfortunately the changes exposes > > this and probably more problems in the compiler. > > > > Doug > > > -----Original Message----- > > > From: Gilmore, Doug > > > Sent: Monday, May 02, 2011 6:21 PM > > > To: open64-devel@lists.sourceforge.net > > > Subject: RE: [Open64-devel] r3574 - in trunk/osprey/common/com: . > > MIPS > > > NVISA SL ia64 loongson ppc32 x8664 > > > > > > With this change my debug build of the compiler on x86-64, that is, > > > configure with --with-build-optimize=DEBUG, breaks during the library > > > build: > > > > > > ### Assertion failure at line 259 of /local/home/dgilmore/sot- > > > pp1/bd/osprey/../../osprey/common/com/x8664/targ_const.cxx: > > > ### Compiler Error during Writing WHIRL file phase: > > > ### High order word of I4 TCON non zero ffffffff > > > opencc INTERNAL ERROR: /local/home/dgilmore/sot- > > > pp1/bd/osprey/.././osprey/targdir/wgen/wgen42 returned non-zero > > status > > > 1 > > > make[3]: *** [malloc_opt.o] Error 1 > > > make[2]: *** [default] Error 2 > > > make[1]: *** [libopen64rt] Error 2 > > > make[1]: Leaving directory `/local/home/dgilmore/sot- > > > pp1/bd/osprey/targdir_lib2' > > > make: *** [lib2] Error 2 > > > > > > Is anyone else seeing this? > > > > > > Doug > > > > > > > -----Original Message----- > > > > From: s...@open64.net [mailto:s...@open64.net] > > > > Sent: Wednesday, April 27, 2011 7:20 PM > > > > To: open64-devel@lists.sourceforge.net > > > > Subject: [Open64-devel] r3574 - in trunk/osprey/common/com: . MIPS > > > > NVISA SL ia64 loongson ppc32 x8664 > > > > > > > > Author: shihui > > > > Date: 2011-04-27 22:20:14 -0400 (Wed, 27 Apr 2011) > > > > New Revision: 3574 > > > > > > > > Modified: > > > > trunk/osprey/common/com/MIPS/targ_const.cxx > > > > trunk/osprey/common/com/NVISA/targ_const.cxx > > > > trunk/osprey/common/com/SL/targ_const.cxx > > > > trunk/osprey/common/com/controls.cxx > > > > trunk/osprey/common/com/ia64/targ_const.cxx > > > > trunk/osprey/common/com/loongson/targ_const.cxx > > > > trunk/osprey/common/com/ppc32/targ_const.cxx > > > > trunk/osprey/common/com/x8664/targ_const.cxx > > > > Log: > > > > Fixing incorrect expression assuming wrong operoator priority. > > > > The priorty of bitwise operator is lower than relational operator. > > > > > > > > Code review by Jianxin and Sun Chan > > > > > > > > > > > > > > > > Modified: trunk/osprey/common/com/MIPS/targ_const.cxx > > > > =================================================================== > > > > --- trunk/osprey/common/com/MIPS/targ_const.cxx 2011-04-26 > > > 05:21:38 UTC > > > > (rev 3573) > > > > +++ trunk/osprey/common/com/MIPS/targ_const.cxx 2011-04-28 > > > 02:20:14 UTC > > > > (rev 3574) > > > > @@ -229,14 +229,14 @@ > > > > case MTYPE_U2: > > > > case MTYPE_U4: > > > > case MTYPE_F4: > > > > - Is_True ( TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > case MTYPE_I8: > > > > case MTYPE_U8: > > > > case MTYPE_F8: > > > > - Is_True ( TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > > > > > Modified: trunk/osprey/common/com/NVISA/targ_const.cxx > > > > =================================================================== > > > > --- trunk/osprey/common/com/NVISA/targ_const.cxx 2011-04-26 > > > > 05:21:38 UTC (rev 3573) > > > > +++ trunk/osprey/common/com/NVISA/targ_const.cxx 2011-04-28 > > > > 02:20:14 UTC (rev 3574) > > > > @@ -243,14 +243,14 @@ > > > > case MTYPE_U2: > > > > case MTYPE_U4: > > > > case MTYPE_F4: > > > > - Is_True ( TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > case MTYPE_I8: > > > > case MTYPE_U8: > > > > case MTYPE_F8: > > > > - Is_True ( TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > > > > > Modified: trunk/osprey/common/com/SL/targ_const.cxx > > > > =================================================================== > > > > --- trunk/osprey/common/com/SL/targ_const.cxx 2011-04-26 > > 05:21:38 UTC > > > > (rev 3573) > > > > +++ trunk/osprey/common/com/SL/targ_const.cxx 2011-04-28 > > 02:20:14 UTC > > > > (rev 3574) > > > > @@ -206,14 +206,14 @@ > > > > case MTYPE_U2: > > > > case MTYPE_U4: > > > > case MTYPE_F4: > > > > - Is_True ( TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > case MTYPE_I8: > > > > case MTYPE_U8: > > > > case MTYPE_F8: > > > > - Is_True ( TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > > > > > Modified: trunk/osprey/common/com/controls.cxx > > > > =================================================================== > > > > --- trunk/osprey/common/com/controls.cxx 2011-04-26 05:21:38 UTC > > > (rev > > > > 3573) > > > > +++ trunk/osprey/common/com/controls.cxx 2011-04-28 02:20:14 UTC > > > (rev > > > > 3574) > > > > @@ -345,7 +345,7 @@ > > > > } CONTROL_GROUP_INFO; > > > > > > > > #define CGI_IS_INT_TYPE 0x0001 > > > > -#define CGI_is_int_type(c) ((c)->flags & > CGI_IS_INT_TYPE > > != 0) > > > > +#define CGI_is_int_type(c) ((((c)->flags) & > > CGI_IS_INT_TYPE) > > > > != 0) > > > > > > > > static O_GR_EXP o_group_expansion[] = { > > > > /*0*/ { "no-opt", > > > > > > > > Modified: trunk/osprey/common/com/ia64/targ_const.cxx > > > > =================================================================== > > > > --- trunk/osprey/common/com/ia64/targ_const.cxx 2011-04-26 > > > 05:21:38 UTC > > > > (rev 3573) > > > > +++ trunk/osprey/common/com/ia64/targ_const.cxx 2011-04-28 > > > 02:20:14 UTC > > > > (rev 3574) > > > > @@ -227,14 +227,14 @@ > > > > case MTYPE_U2: > > > > case MTYPE_U4: > > > > case MTYPE_F4: > > > > - Is_True ( TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > case MTYPE_I8: > > > > case MTYPE_U8: > > > > case MTYPE_F8: > > > > - Is_True ( TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > > > > > Modified: trunk/osprey/common/com/loongson/targ_const.cxx > > > > =================================================================== > > > > --- trunk/osprey/common/com/loongson/targ_const.cxx 2011-04-26 > > > > 05:21:38 UTC (rev 3573) > > > > +++ trunk/osprey/common/com/loongson/targ_const.cxx 2011-04-28 > > > > 02:20:14 UTC (rev 3574) > > > > @@ -235,14 +235,14 @@ > > > > case MTYPE_U2: > > > > case MTYPE_U4: > > > > case MTYPE_F4: > > > > - Is_True ( TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > case MTYPE_I8: > > > > case MTYPE_U8: > > > > case MTYPE_F8: > > > > - Is_True ( TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > > > > > Modified: trunk/osprey/common/com/ppc32/targ_const.cxx > > > > =================================================================== > > > > --- trunk/osprey/common/com/ppc32/targ_const.cxx 2011-04-26 > > > > 05:21:38 UTC (rev 3573) > > > > +++ trunk/osprey/common/com/ppc32/targ_const.cxx 2011-04-28 > > > > 02:20:14 UTC (rev 3574) > > > > @@ -228,14 +228,14 @@ > > > > case MTYPE_U2: > > > > case MTYPE_U4: > > > > case MTYPE_F4: > > > > - Is_True ( TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > case MTYPE_I8: > > > > case MTYPE_U8: > > > > case MTYPE_F8: > > > > - Is_True ( TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > > > > > Modified: trunk/osprey/common/com/x8664/targ_const.cxx > > > > =================================================================== > > > > --- trunk/osprey/common/com/x8664/targ_const.cxx 2011-04-26 > > > > 05:21:38 UTC (rev 3573) > > > > +++ trunk/osprey/common/com/x8664/targ_const.cxx 2011-04-28 > > > > 02:20:14 UTC (rev 3574) > > > > @@ -254,14 +254,14 @@ > > > > case MTYPE_U2: > > > > case MTYPE_U4: > > > > case MTYPE_F4: > > > > - Is_True ( TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v1(*tc)|TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > case MTYPE_I8: > > > > case MTYPE_U8: > > > > case MTYPE_F8: > > > > - Is_True ( TCON_v2(*tc)|TCON_v3(*tc) == 0, > > > > + Is_True ( (TCON_v2(*tc)|TCON_v3(*tc)) == 0, > > > > ("High order word of %s TCON non zero %x", > > > > Mtype_Name(TCON_ty(*tc)), TCON_v1(*tc)) ); > > > > break; > > > > > > > > > > > > ------------------------------------------------------------------- > > -- > > > -- > > > > ------- > > > > WhatsUp Gold - Download Free Network Management Software > > > > The most intuitive, comprehensive, and cost-effective network > > > > management toolset available today. Delivers lowest initial > > > > acquisition cost and overall TCO of any competing solution. > > > > http://p.sf.net/sfu/whatsupgold-sd > > > > _______________________________________________ > > > > Open64-devel mailing list > > > > Open64-devel@lists.sourceforge.net > > > > https://lists.sourceforge.net/lists/listinfo/open64-devel > > > > > > > > ----------------------------------------------------------------------- > > ------- > > WhatsUp Gold - Download Free Network Management Software > > The most intuitive, comprehensive, and cost-effective network > > management toolset available today. Delivers lowest initial > > acquisition cost and overall TCO of any competing solution. > > http://p.sf.net/sfu/whatsupgold-sd > > _______________________________________________ > > Open64-devel mailing list > > Open64-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/open64-devel > > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > Open64-devel mailing list > Open64-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/open64-devel > >
intconst.patch
Description: Binary data
------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________ Open64-devel mailing list Open64-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open64-devel