revision 1.188 (access to fields of a structure at an absolute address);
it breaks with bitfields, extern declarations, and gcse analysis.
* src/SDCCopt.c (isLocalWithoutDef): if ADDRESS_OF applied to a symbol, it
could be assigned through a pointer, so don't complain.
* src/SDCCast.c (astErrors),
* src/SDCCast.h,
* src/SDCCglue.c (emitRegularMap): fixed bug #847813
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3030
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2003-11-26 Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+ * src/SDCCast.c (decorateType): disabled a transformation I added in
+ revision 1.188 (access to fields of a structure at an absolute address);
+ it breaks with bitfields, extern declarations, and gcse analysis.
+ * src/SDCCopt.c (isLocalWithoutDef): if ADDRESS_OF applied to a symbol, it
+ could be assigned through a pointer, so don't complain.
+ * src/SDCCast.c (astErrors),
+ * src/SDCCast.h,
+ * src/SDCCglue.c (emitRegularMap): fixed bug #847813
+
2003-11-26 Vangelis Rokas <vrokas@otenet.gr>
* src/pic16/main.c (_pic16_genIVT): fixed interrupt vector table
2003-11-26 Vangelis Rokas <vrokas@otenet.gr>
* src/pic16/main.c (_pic16_genIVT): fixed interrupt vector table
+ /* This breaks with extern declarations, bitfields, and perhaps other */
+ /* cases (gcse). Let's leave this optimization disabled for now and */
+ /* ponder if there's a safe way to do this. -- EEP */
+ #if 0
if (IS_ADDRESS_OF_OP (tree->left) && IS_AST_SYM_VALUE(tree->left->left)
&& SPEC_ABSA (AST_SYMBOL (tree->left->left)->etype))
{
if (IS_ADDRESS_OF_OP (tree->left) && IS_AST_SYM_VALUE(tree->left->left)
&& SPEC_ABSA (AST_SYMBOL (tree->left->left)->etype))
{
tree->left = NULL;
tree->right = NULL;
}
tree->left = NULL;
tree->right = NULL;
}
return tree;
/*------------------------------------------------------------------*/
return tree;
/*------------------------------------------------------------------*/
{
ast_print(t,stdout,0);
}
{
ast_print(t,stdout,0);
}
+
+
+
+/*-----------------------------------------------------------------*/
+/* astErrors : returns non-zero if errors present in tree */
+/*-----------------------------------------------------------------*/
+int astErrors(ast *t)
+{
+ int errors=0;
+
+ if (t)
+ {
+ if (t->isError)
+ errors++;
+ errors += astErrors(t->left);
+ errors += astErrors(t->right);
+ }
+
+ return errors;
+}
void addSymToBlock (symbol *, ast *);
void freeStringSymbol(symbol *);
DEFSETFUNC(resetParmKey);
void addSymToBlock (symbol *, ast *);
void freeStringSymbol(symbol *);
DEFSETFUNC(resetParmKey);
// exported variables
extern set *operKeyReset;
// exported variables
extern set *operKeyReset;
// but try to do it anyway
}
allocInfo = 0;
// but try to do it anyway
}
allocInfo = 0;
- eBBlockFromiCode (iCodeFromAst (ival));
+ if (!astErrors(ival))
+ eBBlockFromiCode (iCodeFromAst (ival));
if (IS_AGGREGATE (sym->type))
return 0;
if (IS_AGGREGATE (sym->type))
return 0;
+ if (sym->addrtaken)
+ return 0;
+