* device/include/mcs51/P89c51RD2.h,
[fw/sdcc] / src / SDCCpeeph.c
index 478178c6675cd4148b36b14f5d80c539195a06d9..c38627dc2a7e76bfb81779ad823aead57d3c2198 100644 (file)
@@ -238,6 +238,10 @@ FBYNAME (labelIsReturnOnly)
   int len;
   char * retInst;
 
+  /* Don't optimize jumps in a jump table; a more generic test */
+  if (currPl->ic && currPl->ic->op == JUMPTABLE)
+    return FALSE;
+
   label = hTabItemWithKey (vars, 5);
   if (!label) return FALSE;
   len = strlen(label);
@@ -2279,13 +2283,18 @@ initPeepHole ()
   char *s;
 
   /* read in the default rules */
-  readRules (port->peep.default_rules);
+  if (!options.nopeep)
+    {
+      readRules (port->peep.default_rules);
+    }
 
   /* if we have any additional file read it too */
   if (options.peep_file)
     {
       readRules (s = readFileIntoBuffer (options.peep_file));
       setToNull ((void *) &s);
+      /* override nopeep setting, default rules have not been read */
+      options.nopeep = 0;
     }