diff --git a/Changes b/Changes index f1b9b5508..915662741 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,8 @@ indicates the contributor was also the author of the fix; Thanks! * Verilator 3.821**** +**** Fix PowerPC runtime error, bug288. [Ahmed El-Mahmoudy] + **** Fix internal error on integer casts, bug374. [Chandan Egbert] * Verilator 3.820 2011/07/28 diff --git a/src/Makefile_obj.in b/src/Makefile_obj.in index 869630e97..8defbf7d2 100644 --- a/src/Makefile_obj.in +++ b/src/Makefile_obj.in @@ -58,7 +58,7 @@ pkgdatadir = @pkgdatadir@ # Compile options CFG_WITH_DEFENV = @CFG_WITH_DEFENV@ -CPPFLAGSNOWALL += @CPPFLAGS@ +CPPFLAGS += @CPPFLAGS@ LDFLAGS += @LDFLAGS@ #### End of system configuration section. #### @@ -85,17 +85,18 @@ endif # -lfl not needed as Flex invoked with %nowrap option LIBS = -lm -CPPFLAGSNOWALL += -MMD -CPPFLAGSNOWALL += -I. -I$(bldsrc) -I$(srcdir) -I$(incdir) -CPPFLAGSNOWALL += -DYYDEBUG # Required to get nice error messages -#CPPFLAGSNOWALL += -DVL_LEAK_CHECKS # If running valgrind or other hunting tool -CPPFLAGSNOWALL += $(COPT) -CPPFLAGS = $(CPPFLAGSNOWALL) +CPPFLAGS += -MMD +CPPFLAGS += -I. -I$(bldsrc) -I$(srcdir) -I$(incdir) +CPPFLAGS += -DYYDEBUG # Required to get nice error messages +#CPPFLAGS += -DVL_LEAK_CHECKS # If running valgrind or other hunting tool +CPPFLAGS += $(COPT) +CPPFLAGS += -MP # Only works on recent GCC versions ifeq ($(VERILATOR_AUTHOR_SITE),1) # Local... Else don't burden users -CPPFLAGSNOWALL += -MP # Only works on recent GCC versions CPPFLAGS += -W -Wall -Wno-unused-parameter -Wno-char-subscripts -Werror #CPPFLAGS += -pedantic-errors endif +CPPFLAGSWALL = $(CPPFLAGS) +CPPFLAGSNOWALL = $(CPPFLAGS) ifneq ($(SYSTEMPERL),) # Intuit SYSTEMPERL_INCLUDE as it's new SYSTEMPERL_INCLUDE ?= $(SYSTEMPERL)/src @@ -262,9 +263,9 @@ V3Number_test: V3Number_test.o $(PERL) $(ASTGEN) -I$(srcdir) $*.cpp %.o: %.cpp - $(OBJCACHE) ${CXX} ${CPPFLAGS} -c $< + $(OBJCACHE) ${CXX} ${CPPFLAGSWALL} -c $< %.o: %.c - $(OBJCACHE) ${CC} ${CPPFLAGS} -c $< + $(OBJCACHE) ${CC} ${CPPFLAGSWALL} -c $< V3ParseLex.o: V3ParseLex.cpp V3Lexer.yy.cpp V3ParseBison.c $(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $< diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 928aa5d9a..e9713bff4 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -3465,7 +3465,7 @@ struct AstBufIf1 : public AstNodeBiop { virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opBufIf1(lhs,rhs); } virtual string emitVerilog() { return "bufif(%r,%l)"; } virtual string emitC() { V3ERROR_NA; return "";} // Lclean || Rclean - virtual string emitSimpleOperator() { V3ERROR_NA; return false;} // Lclean || Rclean + virtual string emitSimpleOperator() { V3ERROR_NA; return "";} // Lclean || Rclean virtual bool cleanOut() {V3ERROR_NA; return "";} // Lclean || Rclean virtual bool cleanLhs() {return false;} virtual bool cleanRhs() {return false;} virtual bool sizeMattersLhs() {return false;} virtual bool sizeMattersRhs() {return false;} diff --git a/src/V3ParseImp.h b/src/V3ParseImp.h index 87ff0f203..3d5e8b0e9 100644 --- a/src/V3ParseImp.h +++ b/src/V3ParseImp.h @@ -316,7 +316,7 @@ public: public: // CREATORS V3ParseImp(AstNetlist* rootp, V3InFilter* filterp) - : m_sym(rootp), m_filterp(filterp) { + : m_filterp(filterp), m_sym(rootp) { m_fileline = NULL; m_rootp = rootp; m_lexerp = NULL; m_inCellDefine = false; diff --git a/src/V3ParseLex.cpp b/src/V3ParseLex.cpp index d0a4578a9..31a6dd92e 100644 --- a/src/V3ParseLex.cpp +++ b/src/V3ParseLex.cpp @@ -62,7 +62,7 @@ public: void V3ParseImp::stateExitPsl() { parsep()->m_lexerp->stateExitPsl(); } void V3ParseImp::statePushVlg() { parsep()->m_lexerp->stateExitPsl(); } void V3ParseImp::statePop() { parsep()->m_lexerp->statePop(); } -int V3ParseImp::yylexThis() { parsep()->m_lexerp->yylex(); } +int V3ParseImp::yylexThis() { return parsep()->m_lexerp->yylex(); } //###################################################################### // Read class functions diff --git a/src/V3PreLex.l b/src/V3PreLex.l index b739f4d93..5c3e07c26 100644 --- a/src/V3PreLex.l +++ b/src/V3PreLex.l @@ -538,6 +538,7 @@ void V3PreLex::unused() { if (0) { // Prevent unused warnings yy_top_state(); + yyerror((char*)""); } } diff --git a/src/verilog.l b/src/verilog.l index be76cebe4..0df0d81a5 100644 --- a/src/verilog.l +++ b/src/verilog.l @@ -963,7 +963,8 @@ double V3ParseImp::parseDouble(const char* textp, size_t length) { *dp++ = '\0'; char* endp = strgp; double d = strtod(strgp, &endp); - if ((endp-strgp) != length) { yyerrorf("Syntax error parsing real: %s",strgp); } + size_t parsed_len = endp-strgp; + if (parsed_len != length) { yyerrorf("Syntax error parsing real: %s",strgp); } delete strgp; return d; } diff --git a/src/verilog.y b/src/verilog.y index d36515e0a..9e176bc1c 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -71,7 +71,7 @@ public: m_varIO = AstVarType::UNKNOWN; m_varDTypep = NULL; m_pinNum = -1; - m_instModule; + m_instModule = ""; m_instParamp = NULL; m_modp = NULL; m_modTypeImpNum = 0;