From 7c3140796a06e3defa9587283a5ba770eeeb3979 Mon Sep 17 00:00:00 2001 From: maartenbrock Date: Thu, 19 May 2005 15:25:23 +0000 Subject: [PATCH] * support/regression/tests/bug1198642.c: new test * src/SDCCicode.c (isOperandEqual): fixed bug 1198642 * src/SDCCcse.c (findPrevIc): added comment, please have a look * support/scripts/resource.h, * support/scripts/resource.rc, * src/src.dsp: added sdcc.ico to project as icon for sdcc.exe * support/scripts/sdcc.ico: added 32x32 icon git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3766 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 12 ++++- src/SDCCcse.c | 2 +- src/SDCCicode.c | 6 ++- src/src.dsp | 4 ++ support/regression/tests/bug1198642.c | 26 ++++++++++ support/scripts/resource.h | 16 ++++++ support/scripts/resource.rc | 71 ++++++++++++++++++++++++++ support/scripts/sdcc.ico | Bin 1078 -> 1078 bytes 8 files changed, 133 insertions(+), 4 deletions(-) create mode 100644 support/regression/tests/bug1198642.c create mode 100644 support/scripts/resource.h create mode 100644 support/scripts/resource.rc diff --git a/ChangeLog b/ChangeLog index 2c65681f..6e0ef727 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-05-19 Maarten Brock + + * support/regression/tests/bug1198642.c: new test + * src/SDCCicode.c (isOperandEqual): fixed bug 1198642 + * src/SDCCcse.c (findPrevIc): added comment, please have a look + * support/scripts/resource.h, + * support/scripts/resource.rc, + * src/src.dsp: added sdcc.ico to project as icon for sdcc.exe + * support/scripts/sdcc.ico: added 32x32 icon + 2005-05-18 Raphael Neider * device/lib/pic16/libdev/pic18f*.c, @@ -31,7 +41,7 @@ * device/include/mcs51/8052.h: made parseable with lint * device/include/mcs51/lint.h: added include file for (sp)lint * doc/sdccman.lyx: added doc about use of splint (syntax checking tool) - * doc/cdbfileformat.lyx, + * doc/cdbfileformat.lyx, * doc/test_suite_spec.lyx: hardcoded date to the date of last text change 2005-05-14 Raphael Neider diff --git a/src/SDCCcse.c b/src/SDCCcse.c index 4b524b0b..316c5c9c 100644 --- a/src/SDCCcse.c +++ b/src/SDCCcse.c @@ -492,7 +492,7 @@ DEFSETFUNC (findPrevIc) /* if iCodes are not the same */ /* see the operands maybe interchanged */ if (ic->op == cdp->diCode->op && - (ic->op == '+' || ic->op == '*') && + (ic->op == '+' || ic->op == '*') && // MB: why not check for &, &&, |, ||, ^ ??? isOperandEqual (IC_LEFT (ic), IC_RIGHT (cdp->diCode)) && isOperandEqual (IC_RIGHT (ic), IC_LEFT (cdp->diCode))) { diff --git a/src/SDCCicode.c b/src/SDCCicode.c index a0289d04..804771e2 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -1428,8 +1428,10 @@ isOperandEqual (operand * left, operand * right) return isSymbolEqual (left->operand.symOperand, right->operand.symOperand); case VALUE: - return (floatFromVal (left->operand.valOperand) == - floatFromVal (right->operand.valOperand)); + return (compareType (left->operand.valOperand->type, + right->operand.valOperand->type) && + (floatFromVal (left->operand.valOperand) == + floatFromVal (right->operand.valOperand))) case TYPE: if (compareType (left->operand.typeOperand, right->operand.typeOperand) == 1) diff --git a/src/src.dsp b/src/src.dsp index ed94fc91..c15d29dc 100644 --- a/src/src.dsp +++ b/src/src.dsp @@ -112,6 +112,10 @@ SOURCE=..\support\Util\NewAlloc.c # End Source File # Begin Source File +SOURCE=..\support\scripts\resource.rc +# End Source File +# Begin Source File + SOURCE=.\SDCC.lex !IF "$(CFG)" == "src - Win32 Debug" diff --git a/support/regression/tests/bug1198642.c b/support/regression/tests/bug1198642.c new file mode 100644 index 00000000..bce595b8 --- /dev/null +++ b/support/regression/tests/bug1198642.c @@ -0,0 +1,26 @@ +/* + bug1198642.c +*/ + +#include + +void +test_cse_generic_ptr(void) +{ +#if defined(SDCC_mcs51) + volatile void *p1; + volatile void *p2; + + p1 = (data char *)1; + p2 = (idata char *)1; + ASSERT (p1 == p2); + + p1 = (data char *)1; + p2 = (xdata char *)1; + ASSERT (p1 != p2); + + p1 = (data char *)1; + p2 = (idata char *)2; + ASSERT (p1 != p2); +#endif +} diff --git a/support/scripts/resource.h b/support/scripts/resource.h new file mode 100644 index 00000000..c19c0c0b --- /dev/null +++ b/support/scripts/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by resource.rc +// +#define IDI_SDCC 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/support/scripts/resource.rc b/support/scripts/resource.rc new file mode 100644 index 00000000..f0cef64f --- /dev/null +++ b/support/scripts/resource.rc @@ -0,0 +1,71 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_SDCC ICON DISCARDABLE "sdcc.ico" +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/support/scripts/sdcc.ico b/support/scripts/sdcc.ico index b2345db30d83569cf5eafe5151c7ba43e97bb1be..316ee329ab70233d232f190cccbf49c78c1bc983 100644 GIT binary patch literal 1078 zcmcIjyAgvh3>74GjuBkt7$Zx#^cX%`v9^tfBr-9If`myaC1_5p<)L+D3k>2Ai$7zk zFjojiusPVA14Lo(@&bQhEw;_Sh>L`zMevnxxgV3{(Q~U1U*hllr?36my529E<9VOw z==jz3P1W_yXFnfipoz16ztz_-<2mQaH(;If1iOuh8Ak>)T@)nDQ**BOtKY#dZt)fPdac)f*yRrLzwtk}3m-aK_W};rM&SSe delta 101 icmdnSv5jNGyNL_@P?6N+J|>CD3z*m_#hZDUwHN`;up-m| -- 2.30.2