]> git.gag.com Git - fw/sdcc/commitdiff
* support/regression/tests/bug1198642.c: new test
authormaartenbrock <maartenbrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 19 May 2005 15:25:23 +0000 (15:25 +0000)
committermaartenbrock <maartenbrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 19 May 2005 15:25:23 +0000 (15:25 +0000)
* 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
src/SDCCcse.c
src/SDCCicode.c
src/src.dsp
support/regression/tests/bug1198642.c [new file with mode: 0644]
support/scripts/resource.h [new file with mode: 0644]
support/scripts/resource.rc [new file with mode: 0644]
support/scripts/sdcc.ico

index 2c65681f2ab3fe3e61c20f5b307f3f2819cbd8c3..6e0ef727a13b51f2974749cdb94617faadd17eef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-05-19 Maarten Brock <sourceforge.brock AT dse.nl>
+
+       * 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 <rneider AT web.de>
 
        * 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 <rneider AT web.de>
index 4b524b0bf5fb1b82e0a148e3da5e11687f523563..316c5c9c7f8a1eae0d60ade5e424e63f13cb5b09 100644 (file)
@@ -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)))
     {
index a0289d047b80ce72111014f0767f68e019af42d7..804771e2aab107fba7cc3ee04f85ef4a0cffa1e5 100644 (file)
@@ -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)
index ed94fc91629ff3647a075dfc4bfbcb6590aa3d84..c15d29dcf09a688b4eedeca4b8176c63a22ee9d1 100644 (file)
@@ -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 (file)
index 0000000..bce595b
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+   bug1198642.c
+*/
+
+#include <testfwk.h>
+
+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 (file)
index 0000000..c19c0c0
--- /dev/null
@@ -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 (file)
index 0000000..f0cef64
--- /dev/null
@@ -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
+
index b2345db30d83569cf5eafe5151c7ba43e97bb1be..316ee329ab70233d232f190cccbf49c78c1bc983 100644 (file)
Binary files a/support/scripts/sdcc.ico and b/support/scripts/sdcc.ico differ